Closed Bug 1740335 Opened 3 years ago Closed 2 years ago

Add Telemetry for service workers

Categories

(Core :: DOM: Service Workers, enhancement)

enhancement

Tracking

()

RESOLVED FIXED
97 Branch
Tracking Status
firefox97 --- fixed

People

(Reporter: jesup, Assigned: jesup)

References

Details

Attachments

(2 files)

Add Telemetry for ServiceWorkers, so we can understand the impact in the field (especially if we isolate some serviceworkers in the future).

Telemetry items:
Per-session:
Number of registered SW, total and registered for Fetch
Max SW running simultaneously, Max running which handle Fetch

Periodic:
Number of running SW, total and Fetch

Possible:
Histogram of the lifetimes of running ServiceWorkers (total and Fetch)
Histogram of the time to start SW
Histogram of the time to start an operation (i.e. from dispatch until it starts running on the Worker thread).

There should be no issues with private/identifying data for these measurements

We want to record the number of registered and running ServiceWorkers, and
subset them by whether they support Fetch or not, in order to inform
decisions about isolating ServiceWorkers.
Also reenables some of the other ServiceWorker telemetry we used to collect
until FF 102

Attachment #9251477 - Attachment description: Bug 1740335: Add telemetry for the number of service workers r=asuth → Bug 1740335: Add telemetry for the number of service workers r=ytausky
Attachment #9251477 - Attachment description: Bug 1740335: Add telemetry for the number of service workers r=ytausky → Bug 1740335: Add telemetry for the number of service workers r=edenchuang

Comment on attachment 9251477 [details]
Bug 1740335: Add telemetry for the number of service workers r=edenchuang

Request for data collection review form

All questions are mandatory. You must receive review from a data steward peer on your responses to these questions before shipping new data collection.

What questions will you answer with this data?

The effectiveness of isolated ServiceWorkers (launch time, etc). The usage of serviceworkers so we can estimate the impact of making all serviceworkers (or all handling Fetch) isolated.

Why does Mozilla need to answer these questions? Are there benefits for users? Do we need this information to address product or business requirements? Some example responses:

We need to know if the memory hit (or startup performance hit) for users will be high enough to be a problem moving from an allow-list to all SW's isolated.

What alternative methods did you consider to answer these questions? Why were they not sufficient?

We have no way to know how many service workers are being used in the field, especially at one time, nor how many of them are handling Fetch.

Can current instrumentation answer these questions?

No.

List all proposed measurements and indicate the category of data collection for each measurement, using the Firefox data collection categories found on the Mozilla wiki.

SERVICE_WORKER_ISOLATED_LAUNCH_TIME:
Equivalent to SERVICE_WORKER_LAUNCH_TIME_2, but only for process-isolated ServiceWorkers. Category 1 “Technical data”.
SERVICEWORKER_REGISTRATIONS
Replaces expired histogram SERVICEWORKER_REGISTRATIONS. Raw number of SW registrations, with keys All and Fetch. Category 1 “Technical data”.
SERVICE_WORKER_RUNNING
SERVICE_WORKER_FETCH_RUNNING
Histogram of the number of ServiceWorkers (and those handling Fetch) running at a given time, sampled periodically. Category 1 “Technical data”.
SERVICEWORKER_RUNNING_MAX
Scalar indicating the max number of simultaneous running ServiceWorkers (with keys All and Fetch). Category 1 “Technical data”.

Note that the data steward reviewing your request will characterize your data collection based on the highest (and most sensitive) category.
Measurement Description Data Collection Category Tracking Bug #

Please provide a link to the documentation for this data collection which describes the ultimate data set in a public, complete, and accurate way.

This collection is documented in its definitions files Histograms.json, Scalars.yaml, and/or Events.yaml and in the Probe Dictionary at https://probes.telemetry.mozilla.org.

How long will this data be collected? Choose one of the following:

These expire in 102 except for SERVICE_WORKER_ISOLATED_LAUNCH_TIME, which is slated to continue without expiration.

What populations will you measure?

All

Which release channels?

Default for telemetry, except for SERVICE_WORKER_ISOLATED_LAUNCH_TIME, which like SERVICE_WORKER_LAUNCH_TIME_2 will be opt-out in release.

Which countries?

all

Which locales?

all

Any other filters? Please describe in detail below.

No

If this data collection is default on, what is the opt-out mechanism for users?

Standard telemetry opt-out.

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

We will review this as part of decision-making for making isolated ServiceWorkers the default

Where do you intend to share the results of your analysis?

Internally in the DOM worker/storage team and with mconca (Product). It will be visible in our telemetry.

Is there a third-party tool (i.e. not Telemetry) that you are proposing to use for this data collection? If so:

No

Attachment #9251477 - Flags: data-review?(chutten)

Comment on attachment 9251477 [details]
Bug 1740335: Add telemetry for the number of service workers r=edenchuang

In future, please attach data review requests as text attachments to better integrate with the Data Stewardship workflow.

Attachment #9251477 - Flags: data-review?(chutten)
Attached file data collection review
Attachment #9253313 - Flags: data-review?(chutten)

Comment on attachment 9253313 [details]
data collection review

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.

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?

No. This collection will expire in Firefox 102.
:jesup will be responsible for SERVICE_WORKER_ISOLATED_LAUNCH_TIME which will be collected permanently.

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: SERVICE_WORKER_ISOLATED_LAUNCH_TIME.
Default on for pre-release channels only: all others.

Does the instrumentation include the addition of any new identifiers?

No.

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

Yes.

Does the data collection use a third-party collection tool?

No.


Result: datareview+

Attachment #9253313 - Flags: data-review?(chutten) → data-review+
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/5ed325ce740b
Add telemetry for the number of service workers r=dom-worker-reviewers,edenchuang
Flags: needinfo?(rjesup)
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/bb6962712184
Add telemetry for the number of service workers r=dom-worker-reviewers,edenchuang

Backed out changeset bb6962712184 (Bug 1740335) for causing xpcshell failures in test_ext_background_service_worker.js
Backout link: https://hg.mozilla.org/integration/autoland/rev/66db571eaddcb1f88f96926c1724207520900e51
Push with failures, failure log.

Flags: needinfo?(rjesup)
Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/8d0d6a0dadb4
Add telemetry for the number of service workers r=dom-worker-reviewers,edenchuang

Backed out for causing mochitest failures on ServiceWorkerPrivateImpl.h. CLOSED TREE

Backout link : https://hg.mozilla.org/integration/autoland/rev/16b0801c9f7ea68f23071fe1286893258658c5a5

Push with failures : https://treeherder.mozilla.org/jobs?repo=autoland&resultStatus=testfailed%2Cbusted%2Cexception%2Crunnable&revision=8d0d6a0dadb46219ffb12825cc38df7b7267c744&selectedTaskRun=bXUiJQFfT-ylTpN6ZxMiWQ.0

Link to failure log :
https://treeherder.mozilla.org/logviewer?job_id=360518589&repo=autoland&lineNumber=5855
https://treeherder.mozilla.org/logviewer?job_id=360518877&repo=autoland&lineNumber=6502
https://treeherder.mozilla.org/logviewer?job_id=360525169&repo=autoland&lineNumber=4291

Failure message :
Assertion failure: sRunningServiceWorkersFetch == 0, at /builds/worker/checkouts/gecko/dom/serviceworkers/ServiceWorkerPrivateImpl.h:57
PROCESS-CRASH | Last test finished | application crashed [@ mozilla::dom::ServiceWorkerPrivateImpl::CheckRunningShutdown()]

Pushed by rjesup@wgate.com:
https://hg.mozilla.org/integration/autoland/rev/d60a17f4f7bf
Add telemetry for the number of service workers r=dom-worker-reviewers,edenchuang
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 97 Branch
Flags: needinfo?(rjesup)
Regressions: 1752387
See Also: → 1763526
See Also: → 1777401
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: