Bug 1320052 - Clamped count is not double-counted anymore. r=chutten
MozReview-Commit-ID: 284A2Z4QvxM
--- 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)