Bug 1305654 - Fix the SetMaximum C++ API for Scalars. r=gfritzsche
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Tue, 27 Sep 2016 01:32:00 -0400
changeset 315479 d044a6f7756c
parent 315478 96fb89bb31d0
child 315480 17592aa00499
push id20616
push usercbook@mozilla.com
push dateWed, 28 Sep 2016 14:38:03 +0000
treeherderfx-team@9e14e5227101 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgfritzsche
bugs1305654
milestone52.0a1
Bug 1305654 - Fix the SetMaximum C++ API for Scalars. r=gfritzsche
toolkit/components/telemetry/TelemetryScalar.cpp
--- a/toolkit/components/telemetry/TelemetryScalar.cpp
+++ b/toolkit/components/telemetry/TelemetryScalar.cpp
@@ -1692,17 +1692,17 @@ TelemetryScalar::SetMaximum(mozilla::Tel
 {
   StaticMutexAutoLock locker(gTelemetryScalarsMutex);
 
   ScalarBase* scalar = internal_GetRecordableScalar(aId);
   if (!scalar) {
     return;
   }
 
-  scalar->SetValue(aValue);
+  scalar->SetMaximum(aValue);
 }
 
 /**
  * Sets the keyed scalar to the maximum of the current and the passed value.
  *
  * @param aId The scalar enum id.
  * @param aKey The key name.
  * @param aValue The numeric value to set the scalar to.
@@ -1713,17 +1713,17 @@ TelemetryScalar::SetMaximum(mozilla::Tel
 {
   StaticMutexAutoLock locker(gTelemetryScalarsMutex);
 
   KeyedScalar* scalar = internal_GetRecordableKeyedScalar(aId);
   if (!scalar) {
     return;
   }
 
-  scalar->SetValue(aKey, aValue);
+  scalar->SetMaximum(aKey, aValue);
 }
 
 /**
  * Serializes the scalars from the given dataset to a json-style object and resets them.
  * The returned structure looks like {"group1.probe":1,"group1.other_probe":false,...}.
  *
  * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
  * @param aClear Whether to clear out the scalars after snapshotting.