Closed Bug 1375008 Opened 8 years ago Closed 8 years ago

Prioritize submission of Health ping

Categories

(Toolkit :: Telemetry, enhancement, P1)

enhancement

Tracking

()

RESOLVED FIXED
mozilla57
Tracking Status
firefox57 --- fixed

People

(Reporter: katejimmelon, Assigned: katejimmelon)

References

Details

Attachments

(1 file, 2 obsolete files)

No description provided.
Depends on: 1318297
Blocks: 1372228
Priority: -- → P3
Assignee: nobody → kustiuzhanina
Priority: P3 → P1
Attached patch prioritizeHealthPing.patch (obsolete) — Splinter Review
Attachment #8889437 - Flags: review?(gfritzsche)
Comment on attachment 8889437 [details] [diff] [review] prioritizeHealthPing.patch Review of attachment 8889437 [details] [diff] [review]: ----------------------------------------------------------------- This looks good overall, i just have some smaller comments and a test concern. ::: toolkit/components/telemetry/TelemetrySend.jsm @@ +949,5 @@ > > + currentPings = > + currentPings > + .filter(ping => ping.type === "health") > + .concat(currentPings.filter(ping => ping.type !== "health")); Please add a comment on what and why (prioritize health pings to enable low-latency monitoring). This way to write it is probably more clear (using the spread operator): > currentPings = [ > ... currentPings.filter(...), > ... currentPings.filter(...) > ]; ::: toolkit/components/telemetry/tests/unit/test_TelemetryHealthPing.js @@ +115,5 @@ > + // Fake now to be in throttled state > + let now = fakeNow(2050, 1, 2, 0, 0, 0); > + fakeMidnightPingFuzzingDelay(60 * 1000); > + > + [PING_TYPE, PING_TYPE, "health", PING_TYPE].forEach(function (value) { Why not just: for (let value of [...]) { ... @@ +121,5 @@ > + }); > + > + // Move from throttled state > + fakeNow(futureDate(now, 5 * 60 * 1000)); > + let pings = await PingServer.promiseNextPings(4); This could end up waiting until the next SendScheduler activity is triggered. We should make sure that this sends now to avoid this test taking long. I think we could e.g.: - just submitting another ping (ends up doing SendScheduler.triggerSendingPings(true)) - call TelemetrySend.notifyCanUpload() @@ +122,5 @@ > + > + // Move from throttled state > + fakeNow(futureDate(now, 5 * 60 * 1000)); > + let pings = await PingServer.promiseNextPings(4); > + Assert.equal(pings[0].type, "health", "Should have recorded a health ping."); "Should have received the health ping first."
Attachment #8889437 - Flags: review?(gfritzsche) → feedback+
Attached patch prioritizeHealthPing.patch (obsolete) — Splinter Review
Added this lines to test. Test works file, although it worked locally fine too. await TelemetryController.submitExternalPing(PING_TYPE, {}); await TelemetrySend.notifyCanUpload(); var scheduler = Cu.import("resource://gre/modules/TelemetrySend.jsm", {}); scheduler.SendScheduler.triggerSendingPings(true);
Attachment #8889437 - Attachment is obsolete: true
Attachment #8890398 - Flags: review?(gfritzsche)
Comment on attachment 8890398 [details] [diff] [review] prioritizeHealthPing.patch Review of attachment 8890398 [details] [diff] [review]: ----------------------------------------------------------------- Thanks, this looks good with the below addressed. ::: toolkit/components/telemetry/tests/unit/test_TelemetryHealthPing.js @@ +113,5 @@ > + TelemetryHealthPing.testReset(); > + > + let PING_TYPE = "priority-ping"; > + > + // Fake now to be in throttled state Small nit: End comments with ".". "Make sure sending is throttled to batch up pings."? @@ +121,5 @@ > + for (let value of [PING_TYPE, PING_TYPE, "health", PING_TYPE]) { > + TelemetryController.submitExternalPing(value, {}); > + } > + > + // Move from throttled state "Now trigger sending pings again."? @@ +124,5 @@ > + > + // Move from throttled state > + fakeNow(futureDate(now, 5 * 60 * 1000)); > + await TelemetryController.submitExternalPing(PING_TYPE, {}); > + await TelemetrySend.notifyCanUpload(); One of these two lines should be enough here.
Attachment #8890398 - Flags: review?(gfritzsche) → review+
Thank you for the review. Coul you, please, push on try?
Attachment #8890398 - Attachment is obsolete: true
Keywords: checkin-needed
Pushed by cbook@mozilla.com: https://hg.mozilla.org/integration/mozilla-inbound/rev/e51091c6c11a Prioritize submission of Health ping. r=gfritzsche
Keywords: checkin-needed
Status: NEW → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla57
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: