Closed Bug 1360916 Opened 9 years ago Closed 9 years ago

Update telemetry code in sessionstore content script

Categories

(Firefox :: Session Restore, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 55
Tracking Status
firefox55 --- fixed

People

(Reporter: ttaubert, Assigned: ttaubert)

Details

Attachments

(1 file, 1 obsolete file)

The code in content-sessionStore.js is currently a mix of directly grabbing Services.telemetry, as well as sending measurements to the parent process because Telemetry in the content process wasn't properly supported in the old days. We should stop sending stuff to the parent ourselves if the framework can do it for us. Secondly, we should collect more fine-grained data about how long each of the different data collections take.
Assignee: nobody → ttaubert
Status: NEW → ASSIGNED
Oh, also: the current collection via the MessageQueue overrides values if they're collected twice shortly in succession. So we'd have that fixed too.
Attachment #8863232 - Flags: review?(mdeboer)
Attachment #8863232 - Flags: feedback?(benjamin)
Comment on attachment 8863232 [details] [diff] [review] 0001-Bug-1360916-Update-telemetry-code-in-sessionstore-co.patch Review of attachment 8863232 [details] [diff] [review]: ----------------------------------------------------------------- r=me with the one comment addressed. Looks great! ::: browser/components/sessionstore/content/content-sessionStore.js @@ +13,5 @@ > > Cu.import("resource://gre/modules/XPCOMUtils.jsm", this); > Cu.import("resource://gre/modules/Timer.jsm", this); > Cu.import("resource://gre/modules/Services.jsm", this); > +Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this); I think we should use a lazy module getter here, just to keep content process boot time as low as possible.
Attachment #8863232 - Flags: review?(mdeboer) → review+
Comment on attachment 8863232 [details] [diff] [review] 0001-Bug-1360916-Update-telemetry-code-in-sessionstore-co.patch >diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json >- "FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_LONGEST_OP_MS": { >+ "FX_SESSION_RESTORE_CONTENT_COLLECT_DATA_MS": { > "alert_emails": ["session-restore-telemetry-alerts@mozilla.com"], >- "expires_in_version": "default", >+ "expires_in_version": "never", > "kind": "exponential", >+ "keyed": true, > "high": 30000, >- "n_buckets": 10, >- "description": "Session restore: Duration of the longest uninterruptible operation while collecting data in the content process (ms)" >+ "n_buckets": 20, >+ "bug_numbers": [1360916], >+ "description": "Session restore: Duration of data collection in the content process (ms)" > }, Because this is an old (pre-data-review) probe, I have two kinds of comments; things that we should address before landing this now, and legacy issues that you should address either now or with a followup bug: Now (this change): * You're making this a keyed histogram, so you need to document the key format/possible key values. Since this is a source of privacy risk, I'll want to review this again. * Since you're changing the collection method of probes such as FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS, it might be a goodd idea to version the probe, e.g. FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS_2. Legacy/followup (this probe and other affected probes): * In addition to the session-restore-telemetry-alerts@mozilla.com mailing list, please add a real person to the "alert_emails" field: a module owner/peer who's taking responsibility for this data collection. * Any expires: never measurement should have: ** unit tests that the data is being collected correctly ** a documented analysis plan that describes how you're monitoring the data over the long term
Attachment #8863232 - Flags: feedback?(benjamin) → feedback-
(In reply to Mike de Boer [:mikedeboer] from comment #3) > > +Cu.import("resource://gre/modules/TelemetryStopwatch.jsm", this); > > I think we should use a lazy module getter here, just to keep content > process boot time as low as possible. Done.
(In reply to Benjamin Smedberg [:bsmedberg] from comment #4) > * You're making this a keyed histogram, so you need to document the key > format/possible key values. Since this is a source of privacy risk, I'll > want to review this again. Documented that currently there are the following keys: historychange, scroll, formdata, pageStyle, disallow, storage, storagechange, isPrivate. They denote that the user navigated, scrolled a page, typed something or changed a dropdown, chose a different page style, have docShell that disallows some feature(s), visited a page that modified DOMSessionStorage data, have a tab that is private (usually in a private window). Of all those I could see that the last might be problematic. I'd be totally fine with skipping the probe for that specific key. I'm not at all concerned that this takes too much time. The new patch implements that. > * Since you're changing the collection method of probes such as > FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS, it might be a good idea > to version the probe, e.g. > FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS_2. I'm not actually changing the probe itself, it's merely submitted via content process telemetry now. Do you still think it should be versioned? > Legacy/followup (this probe and other affected probes): > * In addition to the session-restore-telemetry-alerts@mozilla.com mailing > list, please add a real person to the "alert_emails" field: a module > owner/peer who's taking responsibility for this data collection. I added Mike to the list as I won't be able to keep working on session restore. I'll let him object if he doesn't like that :) > * Any expires: never measurement should have: > ** unit tests that the data is being collected correctly > ** a documented analysis plan that describes how you're monitoring the data > over the long term Yeah, that's probably a good idea. I changed expires_in_version to 60 for now as we're mainly looking for things to address in time for Fx 57. When that probe is about to expire we can reevaluate whether we want to make it permanent.
Attachment #8863232 - Attachment is obsolete: true
Attachment #8863661 - Flags: review?(mdeboer)
Attachment #8863661 - Flags: feedback?(benjamin)
Comment on attachment 8863661 [details] [diff] [review] 0001-Bug-1360916-Update-telemetry-code-in-sessionstore-co.patch, v2 data-r=me
Attachment #8863661 - Flags: feedback?(benjamin) → feedback+
Comment on attachment 8863661 [details] [diff] [review] 0001-Bug-1360916-Update-telemetry-code-in-sessionstore-co.patch, v2 Review of attachment 8863661 [details] [diff] [review]: ----------------------------------------------------------------- r=me, thanks!
Attachment #8863661 - Flags: review?(mdeboer) → review+
Pushed by ttaubert@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/ec64ea9b1249 Update telemetry code in sessionstore content script r=mikedeboer data-r=bsmedberg
Backed out for failing browser_sessionStorage_size.js: https://hg.mozilla.org/integration/mozilla-inbound/rev/6cacaa5d72f1fa2109df3c260103f2ab1a608c2a Push with failures: https://treeherder.mozilla.org/#/jobs?repo=mozilla-inbound&revision=ec64ea9b1249ab4d76abf8b01ea4ebb74a24d2ef&filter-resultStatus=testfailed&filter-resultStatus=busted&filter-resultStatus=exception&filter-resultStatus=retry&filter-resultStatus=usercancel&filter-resultStatus=runnable Failure log: https://treeherder.mozilla.org/logviewer.html#?job_id=96065312&repo=mozilla-inbound 15:05:43 INFO - TEST-START | browser/components/sessionstore/test/browser_sessionStorage_size.js 15:05:43 INFO - GECKO(1807) | ++DOCSHELL 0x11429b800 == 3 [pid = 1840] [id = {12828976-e84f-4a42-be2b-4def926d91da}] 15:05:43 INFO - GECKO(1807) | ++DOMWINDOW == 21 (0x1142a2000) [pid = 1840] [serial = 102] [outer = 0x0] 15:05:43 INFO - GECKO(1807) | ++DOMWINDOW == 22 (0x11d827800) [pid = 1840] [serial = 103] [outer = 0x1142a2000] 15:05:43 INFO - GECKO(1807) | ++DOMWINDOW == 23 (0x11d81a800) [pid = 1840] [serial = 104] [outer = 0x1142a2000] 15:05:43 INFO - GECKO(1807) | ++DOCSHELL 0x112eab000 == 4 [pid = 1840] [id = {ea79178b-a43f-4746-8ee9-608a49971f0f}] 15:05:43 INFO - GECKO(1807) | ++DOMWINDOW == 24 (0x11d82c800) [pid = 1840] [serial = 105] [outer = 0x0] 15:05:43 INFO - GECKO(1807) | ++DOMWINDOW == 25 (0x11e078800) [pid = 1840] [serial = 106] [outer = 0x11d82c800] 15:05:44 INFO - TEST-INFO | started process screencapture 15:05:44 INFO - TEST-INFO | screencapture: exit 0 15:05:44 INFO - Buffered messages logged at 15:05:43 15:05:44 INFO - Entering test bound test_telemetry 15:05:44 INFO - Buffered messages finished 15:05:44 INFO - TEST-UNEXPECTED-FAIL | browser/components/sessionstore/test/browser_sessionStorage_size.js | false == true - JS frame :: chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_sessionStorage_size.js :: test_telemetry :: line 27 15:05:44 INFO - Stack trace: 15:05:44 INFO - chrome://mochitests/content/browser/browser/components/sessionstore/test/browser_sessionStorage_size.js:test_telemetry:27 15:05:44 INFO - Tester_execTest@chrome://mochikit/content/browser-test.js:752:9 15:05:44 INFO - Tester.prototype.nextTest</<@chrome://mochikit/content/browser-test.js:672:7 15:05:44 INFO - SimpleTest.waitForFocus/waitForFocusInner/focusedOrLoaded/<@chrome://mochikit/content/tests/SimpleTest/SimpleTest.js:795:59 15:05:44 INFO - Leaving test bound test_telemetry
Flags: needinfo?(ttaubert)
(In reply to Sebastian Hengst [:aryx][:archaeopteryx] (needinfo on intermittent or backout) from comment #11) > Backed out for failing browser_sessionStorage_size.js: Sorry about that. Needed to update the test.
Flags: needinfo?(ttaubert)
Pushed by ttaubert@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/8876f4bca8b6 Update telemetry code in sessionstore content script r=mikedeboer data-r=bsmedberg
Pushed by ttaubert@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/1167aa2f30cd Fix timeouts in browser_sessionStorage_size.js r=bustage
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 55
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: