Closed Bug 1202706 Opened 4 years ago Closed 2 months ago

DOM APIs UseCounter should work on web workers

Categories

(Core :: DOM: Core & HTML, enhancement, P2)

enhancement

Tracking

()

RESOLVED FIXED
mozilla73
Tracking Status
firefox43 --- wontfix
firefox70 --- wontfix
firefox71 - wontfix
firefox72 --- wontfix
firefox73 --- fixed

People

(Reporter: nsm, Assigned: edgar)

References

(Blocks 2 open bugs)

Details

Attachments

(5 files, 1 obsolete file)

We have various DOM APIs used on workers, some of which are going to be used more on workers than on the main thread in the long run (ServiceWorker Cache API, some aspects of Notification API, fetch(), Push), so we should definitely add UseCounter support off main thread.
Component: DOM → DOM: Core & HTML
Status: NEW → RESOLVED
Closed: 5 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1410468

Bug 1410468 is for the Javascript telemetry on workers, this bug is for DOM API use counters on workers.

Status: RESOLVED → REOPENED
Resolution: DUPLICATE → ---
Type: defect → enhancement
Summary: UseCounter should work on web workers → DOM APIs UseCounter should work on web workers
Assignee: nobody → echen
Priority: -- → P2

Liz, we've worked with Product team to put this into Q4 plan. We probably won't make it in 70.

Flags: needinfo?(lhenry)

OK, thanks for letting me know.

Tracking for 71

After we're done with other Fission work, we can be switch to this work.

For the DOM APIs use counters on window, we have:

  • USE_COUNTER2_*_DOCUMENT and USE_COUNTER2_*_PAGE: to record the APIs usages of documents and pages. CONTENT_DOCUMENTS_DESTROYED.
  • CONTENT_DOCUMENTS_DESTROYED and TOP_LEVEL_CONTENT_DOCUMENTS_DESTROYED: telemetry uses as the denominator.

For the use counters on worker, IMHO, we should have separated data for different types of worker, so I plan to add:

  • USE_COUNTER2_*_DEDICATEDWORKER, USE_COUNTER2_*_SHAREDWORKER and USE_COUNTER2_*_SERVICEWORKER: the APIs usage for each type of worker.
  • DEDICATEDWORKER_DESTROYED, SHAREDWORKER_DESTROYED and SERVICEWORKER_DESTROYED: As the denominator.

But if we think it is not necessary to distinguish the worker type, then we could just add USE_COUNTER2_*_WORKER and WORKER_DESTROYED. What do you think? Thanks.

Flags: needinfo?(tdsmith)
Flags: needinfo?(nfroyd)
Flags: needinfo?(bzbarsky)

Not really my code, but in general I think gathering more specific information is better than less specific information. So we should have separate sets of use counters for each worker type, IMHO.

Flags: needinfo?(nfroyd)

I'd prefer separate counters by worker type, yes, as long as it does not slow down the bindings code too much.

Flags: needinfo?(bzbarsky)

Sorry for the slow response. I don't understand workers deeply but the thing that I think would be interesting to understand for webcompat is how many pages use workers that used a given API, for the kinds of workers (if any?) that are controlled by a single page. Is that reasonable?

Flags: needinfo?(tdsmith)

(In reply to Tim Smith 👨‍🔬 [:tdsmith] from comment #10)

Sorry for the slow response. I don't understand workers deeply but the thing that I think would be interesting to understand for webcompat is how many pages use workers that used a given API, for the kinds of workers (if any?) that are controlled by a single page. Is that reasonable?

Yes, I think it is reasonable to record such information for the worker that is controlled by a single page, i.e dedicated worker. Especially if a page creates a lot of workers that use a given API, we could have a more accurate overview from page points of view.

Blocks: 1599034

Hi chutten, would you mind also take a look at the telemetry changes in part1 patch? Thank you.

Flags: needinfo?(chutten)
Attached file data_collection_request_form (obsolete) —
Attachment #9111607 - Attachment mime type: application/octet-stream → text/plain
Comment on attachment 9111607 [details]
data_collection_request_form

Tim, could you help to complete the data review request form, especially for the

> 9). Please provide a general description of how you will analyze this data.

and

> 10). Where do you intend to share the results of your analysis?

Thanks
Flags: needinfo?(tdsmith)
Flags: needinfo?(chutten)
Attached file Data review request

Thanks!

Attachment #9111607 - Attachment is obsolete: true
Flags: needinfo?(tdsmith)
Attachment #9111798 - Flags: data-review?(chutten)
Comment on attachment 9111798 [details]
Data review request

DATA COLLECTION REVIEW RESPONSE:

    Is there or will there be documentation that describes the schema for the ultimate data set available publicly, complete and accurate?

Yes. This collection is Telemetry so is documented in its definitions file [UseCountersWorker.conf](https://hg.mozilla.org/mozilla-central/file/tip/dom/base/UseCountersWorker.conf) and the [Probe Dictionary](https://telemetry.mozilla.org/probe-dictionary/).

    Is there a control mechanism that allows the user to turn the data collection on and off?

Yes. This collection is Telemetry so can be controlled through Firefox's Preferences.

    If the request is for permanent data collection, is there someone who will monitor the data over time?

Yes, :tdsmith is responsible.

    Using the category system of data types on the Mozilla wiki, what collection type of data do the requested measurements fall under?

Category 1, Technical.

    Is the data collection request for default-on or default-off?

Default on for all channels.

    Does the instrumentation include the addition of any new identifiers?

No.

    Is the data collection covered by the existing Firefox privacy notice?

Yes.

    Does there need to be a check-in in the future to determine whether to renew the data?

No. This collection is permanent.

---
Result: datareview+
Attachment #9111798 - Flags: data-review?(chutten) → data-review+
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/38419ebb5494
Part 1: Add telemetry histograms for worker use counters; r=chutten,bzbarsky
https://hg.mozilla.org/integration/autoland/rev/b8068238928b
Part 2: Add support for recording and reporting use counters for workers; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/5b8427cf16b3
Part 3: Hook up worker use counters to WebIDL bindings; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/10409e01c086
Part 4: Add tests for worker use counters; r=bzbarsky

I confirmed with Webcompat and metrics team that it's good to let this bug ride the train from the nightly after 72 softfreeze.
Should we just move the firefox71-status to wontfix and 72-status to fixoptional?

Flags: needinfo?(pascalc)
Pushed by echen@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4989bb2f4f69
Part 1: Add telemetry histograms for worker use counters; r=chutten,bzbarsky
https://hg.mozilla.org/integration/autoland/rev/9eeb03a503fb
Part 2: Add support for recording and reporting use counters for workers; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/95b8b6b94213
Part 3: Hook up worker use counters to WebIDL bindings; r=bzbarsky
https://hg.mozilla.org/integration/autoland/rev/2dfc53add3de
Part 4: Add tests for worker use counters; r=bzbarsky
You need to log in before you can comment on or make changes to this bug.