Closed Bug 1188423 Opened 9 years ago Closed 9 years ago

Investigate and remove |*loadHistograms| methods from TelemetryStorage

Categories

(Toolkit :: Telemetry, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla44
Tracking Status
firefox42 --- affected
firefox44 --- fixed

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)

|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
Blocks: 1122482
Whiteboard: [unifiedTelemetry]
Blocks: 1201022
No longer blocks: 1122482
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
Robert, would you be interested in taking this?
Flags: needinfo?(robertthyberg)
Mentor: gfritzsche
Whiteboard: [unifiedTelemetry] → [unifiedTelemetry] [lang=js] [good next bug]
yeah sounds good
Flags: needinfo?(robertthyberg)
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
Attached patch removed_loadHistograms (obsolete) — Splinter Review
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 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)
Attachment #8662853 - Attachment is patch: true
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+
Assignee: nobody → robertthyberg
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla44
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: