Bug 1320052 - Clamped count is not double-counted anymore. r=chutten draft
authorJan-Erik Rediger <jrediger@mozilla.com>
Thu, 03 May 2018 10:20:09 +0200
changeset 791451 9463ec0f52bc7781bf6c992942e7290cf6560500
parent 791450 13335d8278a5d417f65d426f3baaa0a92e8b1519
child 791452 ecf8ba8e58f98c6bca7e768accf9ca2507daeec6
push id108818
push userbmo:jrediger@mozilla.com
push dateFri, 04 May 2018 13:17:24 +0000
reviewerschutten
bugs1320052
milestone61.0a1
Bug 1320052 - Clamped count is not double-counted anymore. r=chutten MozReview-Commit-ID: 284A2Z4QvxM
toolkit/components/telemetry/Scalars.yaml
toolkit/components/telemetry/tests/gtest/TestHistograms.cpp
--- a/toolkit/components/telemetry/Scalars.yaml
+++ b/toolkit/components/telemetry/Scalars.yaml
@@ -1124,18 +1124,16 @@ telemetry:
       - all
 
   accumulate_clamped_values:
     bug_numbers:
       - 1438335
     description: >
       The count of accumulations that had to be clamped down to not overflow,
       keyed to the histogram name of the overflowing accumulation.
-      This is doubled for non-keyed desktop Firefox Histograms because of
-      saved-session pings.
     expires: never
     kind: uint
     keyed: true
     notification_emails:
       - telemetry-client-dev@mozilla.com
       - chutten@mozilla.com
     release_channel_collection: opt-in
     record_in_processes:
--- a/toolkit/components/telemetry/tests/gtest/TestHistograms.cpp
+++ b/toolkit/components/telemetry/tests/gtest/TestHistograms.cpp
@@ -351,18 +351,18 @@ TEST_F(TelemetryTestFixture, AccumulateL
   const uint32_t kExpectedCountFirst = 2;
   // We expect 2147483646 to be in the last bucket, as well the two samples above 2^31
   // (prior to bug 1438335, values between INT_MAX and UINT32_MAX would end up as 0s)
   const uint32_t kExpectedCountLast = 3;
   ASSERT_EQ(uCountFirst, kExpectedCountFirst) << "The first bucket did not accumulate the correct number of values";
   ASSERT_EQ(uCountLast, kExpectedCountLast) << "The last bucket did not accumulate the correct number of values";
 
   // We accumulated two values that had to be clamped. We expect the count in
-  // 'telemetry.accumulate_clamped_values' to be 4
-  const uint32_t expectedAccumulateClampedCount = 4;
+  // 'telemetry.accumulate_clamped_values' to be 2 (only one storage).
+  const uint32_t expectedAccumulateClampedCount = 2;
   JS::RootedValue scalarsSnapshot(cx.GetJSContext());
   GetScalarsSnapshot(true, cx.GetJSContext(),&scalarsSnapshot);
   CheckKeyedUintScalar("telemetry.accumulate_clamped_values",
                        "TELEMETRY_TEST_LINEAR", cx.GetJSContext(),
                        scalarsSnapshot, expectedAccumulateClampedCount);
 }
 
 TEST_F(TelemetryTestFixture, AccumulateKeyedCountHistogram_MultipleSamples)