Closed
Bug 1188423
Opened 9 years ago
Closed 9 years ago
Investigate and remove |*loadHistograms| methods from TelemetryStorage
Categories
(Toolkit :: Telemetry, defect)
Toolkit
Telemetry
Tracking
()
RESOLVED
FIXED
mozilla44
People
(Reporter: Dexter, Assigned: robertthyberg, Mentored)
References
(Blocks 1 open bug)
Details
(Whiteboard: [unifiedTelemetry] [lang=js] [good next bug])
Attachments
(1 file, 1 obsolete file)
9.73 KB,
patch
|
gfritzsche
:
review+
|
Details | Diff | Splinter Review |
|TelemetryStorage.testLoadHistograms| and |TelemetryStorage.loadHistograms| don't seem to be used anymore in [1].
Moreover, TelemetryStorage.loadHistograms was populating the READ_SAVED_PING_SUCCESS histogram [2]: only |addPendingPing| is doing that at the moment, so the data in that histogram may not be trustworthy.
We should probably remove the loadHistograms* functions and the READ_SAVED_PING_SUCCESS histogram, since bug 1187340 is adding a new probe anyway.
[1] - https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/toolkit/components/telemetry/TelemetryStorage.jsm#l340
[2] - https://hg.mozilla.org/mozilla-central/annotate/2ddec2dedced/toolkit/components/telemetry/TelemetryStorage.jsm#l1260
Reporter | ||
Updated•9 years ago
|
Whiteboard: [unifiedTelemetry]
Reporter | ||
Updated•9 years ago
|
Comment 1•9 years ago
|
||
TelemetryStorage.loadHistograms is not used anywhere.
The only use of testLoadHistograms is here:
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js#497
We can simply remove that test - it tests the loading and deletion of invalid JSON which is covered here too:
https://dxr.mozilla.org/mozilla-central/source/toolkit/components/telemetry/tests/unit/test_TelemetrySendOldPings.js#312
Comment 2•9 years ago
|
||
Robert, would you be interested in taking this?
Flags: needinfo?(robertthyberg)
Updated•9 years ago
|
Mentor: gfritzsche
Whiteboard: [unifiedTelemetry] → [unifiedTelemetry] [lang=js] [good next bug]
Comment 4•9 years ago
|
||
While we're cleaning up those functions, addPendingPingFromFile() is unused too:
https://dxr.mozilla.org/mozilla-central/search?q=addPendingPingFromFile&redirect=false&case=true&limit=69&offset=0
That makes READ_SAVED_PING_SUCCESS definitely useless, so we should remove it from the histograms list too:
https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/toolkit/components/telemetry/Histograms.json#5257
there were a few more assert() references to READ_SAVED_PING_SUCCESS that I ended up removing in test_TelemetrySession.js
Attachment #8662824 -
Flags: review?(gfritzsche)
Comment 6•9 years ago
|
||
Comment on attachment 8662824 [details] [diff] [review]
removed_loadHistograms
Review of attachment 8662824 [details] [diff] [review]:
-----------------------------------------------------------------
::: toolkit/components/telemetry/tests/unit/test_TelemetrySession.js
@@ -286,4 @@
> const TELEMETRY_TEST_COUNT = "TELEMETRY_TEST_COUNT";
> const TELEMETRY_TEST_KEYED_FLAG = "TELEMETRY_TEST_KEYED_FLAG";
> const TELEMETRY_TEST_KEYED_COUNT = "TELEMETRY_TEST_KEYED_COUNT";
> const READ_SAVED_PING_SUCCESS = "READ_SAVED_PING_SUCCESS";
We should remove this line too.
@@ -290,5 @@
>
> if (successfulPings > 0) {
> Assert.ok(TELEMETRY_PING in payload.histograms);
> }
> - Assert.ok(READ_SAVED_PING_SUCCESS in payload.histograms);
There is one more location here that needs cleanup:
https://dxr.mozilla.org/mozilla-central/rev/9ed17db42e3e46f1c712e4dffd62d54e915e0fac/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js#349
I recommend to run the unit tests locally to confirm this works properly:
mach xpcshell-test toolkit/components/telemetry/tests/unit/
Attachment #8662824 -
Flags: review?(gfritzsche) → feedback+
Yeah the test worked. I just forgot to refresh my patch before I uploaded it
Attachment #8662824 -
Attachment is obsolete: true
Attachment #8662853 -
Flags: review?(gfritzsche)
Updated•9 years ago
|
Attachment #8662853 -
Attachment is patch: true
Comment 8•9 years ago
|
||
Comment on attachment 8662853 [details] [diff] [review]
removed_loadHistograms
Review of attachment 8662853 [details] [diff] [review]:
-----------------------------------------------------------------
Looks good, thanks!
Attachment #8662853 -
Flags: review?(gfritzsche) → review+
Updated•9 years ago
|
Keywords: checkin-needed
Updated•9 years ago
|
Assignee: nobody → robertthyberg
Keywords: checkin-needed
Comment 10•9 years ago
|
||
Status: NEW → RESOLVED
Closed: 9 years ago
status-firefox44:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in
before you can comment on or make changes to this bug.
Description
•