Bug 1375481 - Removed unnecessary clearings of histograms draft
authorNils M. <nm.mozilla@mailbox.org>
Mon, 26 Jun 2017 22:57:10 +0200
changeset 600440 08a7714f301336b815b3f59e0da05ca4accafe16
parent 600225 c01aa84ded7eb0b3e691f8bcc5cd887c960a779e
child 634997 ad2d25622b8cf3c159a888522e47711766dd7174
push id65764
push userbmo:nm.mozilla@mailbox.org
push dateMon, 26 Jun 2017 20:59:54 +0000
bugs1375481
milestone56.0a1
Bug 1375481 - Removed unnecessary clearings of histograms MozReview-Commit-ID: 3vyJucWa6tq
toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
--- a/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
+++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySend.js
@@ -320,20 +320,16 @@ add_task(async function test_discardBigP
   let histSendTimeFail = Telemetry.getHistogramById("TELEMETRY_SEND_FAILURE");
   for (let h of [histSizeExceeded, histDiscardedSize, histSuccess, histSendTimeSuccess, histSendTimeFail]) {
     h.clear();
   }
 
   // Generate a 2MB string and create an oversized payload.
   const OVERSIZED_PAYLOAD = {"data": generateRandomString(2 * 1024 * 1024)};
 
-  // Reset the histograms.
-  Telemetry.getHistogramById("TELEMETRY_PING_SIZE_EXCEEDED_SEND").clear();
-  Telemetry.getHistogramById("TELEMETRY_DISCARDED_SEND_PINGS_SIZE_MB").clear();
-
   // Submit a ping of a normal size and check that we don't count it in the histogram.
   await TelemetryController.submitExternalPing(TEST_PING_TYPE, { test: "test" });
   await TelemetrySend.testWaitOnOutgoingPings();
 
   Assert.equal(histSizeExceeded.snapshot().sum, 0, "Telemetry must report no oversized ping submitted.");
   Assert.equal(histDiscardedSize.snapshot().sum, 0, "Telemetry must report no oversized pings.");
   Assert.deepEqual(histSuccess.snapshot().counts, [0, 1, 0], "Should have recorded sending success.");
   Assert.equal(histogramValueCount(histSendTimeSuccess.snapshot()), 1, "Should have recorded send success time.");