Bug 1509814 - Remove old, deprecated methods r=chutten
authorJan-Erik Rediger <jrediger@mozilla.com>
Mon, 26 Nov 2018 17:46:29 +0000
changeset 505001 48f92342f2638cca29f13430046b1294fcb18c17
parent 505000 361a75deb3cedb5dd1c65d881fa16d97efb0f144
child 505002 646caf2d457718a4931d31f637be2e2757c72127
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerschutten
bugs1509814
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1509814 - Remove old, deprecated methods r=chutten The new API should be used everywhere: * getSnapshotForScalars * getSnapshotForKeyedScalars * getSnapshotForHistograms * getSnapshotForKeyedHistograms Differential Revision: https://phabricator.services.mozilla.com/D12892
toolkit/components/telemetry/core/Telemetry.cpp
toolkit/components/telemetry/core/nsITelemetry.idl
--- a/toolkit/components/telemetry/core/Telemetry.cpp
+++ b/toolkit/components/telemetry/core/Telemetry.cpp
@@ -669,34 +669,16 @@ TelemetryImpl::GetSnapshotForKeyedScalar
 {
   unsigned int dataset = mCanRecordExtended ?
     nsITelemetry::DATASET_RELEASE_CHANNEL_OPTIN :
     nsITelemetry::DATASET_RELEASE_CHANNEL_OPTOUT;
   return TelemetryScalar::CreateKeyedSnapshots(dataset, aClearStore, aCx, 1,
                                                aResult, aFilterTest, aStoreName);
 }
 
-NS_IMETHODIMP
-TelemetryImpl::SnapshotHistograms(unsigned int aDataset,
-                                  bool aClearHistograms, JSContext* aCx,
-                                  JS::MutableHandleValue aResult)
-{
-  return TelemetryHistogram::CreateHistogramSnapshots(aCx, aResult, NS_LITERAL_CSTRING("main"), aDataset,
-                                                      aClearHistograms);
-}
-
-NS_IMETHODIMP
-TelemetryImpl::SnapshotKeyedHistograms(unsigned int aDataset,
-                                       bool aClearHistograms, JSContext* aCx,
-                                       JS::MutableHandleValue aResult)
-{
-  return TelemetryHistogram::GetKeyedHistogramSnapshots(aCx, aResult, NS_LITERAL_CSTRING("main"), aDataset,
-                                                        aClearHistograms);
-}
-
 bool
 TelemetryImpl::GetSQLStats(JSContext *cx, JS::MutableHandle<JS::Value> ret, bool includePrivateSql)
 {
   JS::Rooted<JSObject*> root_obj(cx, JS_NewPlainObject(cx));
   if (!root_obj)
     return false;
   ret.setObject(*root_obj);
 
@@ -1720,25 +1702,16 @@ TelemetryImpl::ScalarSet(const nsACStrin
 
 NS_IMETHODIMP
 TelemetryImpl::ScalarSetMaximum(const nsACString& aName, JS::HandleValue aVal, JSContext* aCx)
 {
   return TelemetryScalar::SetMaximum(aName, aVal, aCx);
 }
 
 NS_IMETHODIMP
-TelemetryImpl::SnapshotScalars(unsigned int aDataset, bool aClearScalars, JSContext* aCx,
-                               uint8_t optional_argc, JS::MutableHandleValue aResult)
-{
-  return TelemetryScalar::CreateSnapshots(aDataset, aClearScalars, aCx,
-                                          optional_argc, aResult, false,
-                                          NS_LITERAL_CSTRING("main"));
-}
-
-NS_IMETHODIMP
 TelemetryImpl::KeyedScalarAdd(const nsACString& aName, const nsAString& aKey,
                               JS::HandleValue aVal, JSContext* aCx)
 {
   return TelemetryScalar::Add(aName, aKey, aVal, aCx);
 }
 
 NS_IMETHODIMP
 TelemetryImpl::KeyedScalarSet(const nsACString& aName, const nsAString& aKey,
@@ -1750,25 +1723,16 @@ TelemetryImpl::KeyedScalarSet(const nsAC
 NS_IMETHODIMP
 TelemetryImpl::KeyedScalarSetMaximum(const nsACString& aName, const nsAString& aKey,
                               JS::HandleValue aVal, JSContext* aCx)
 {
   return TelemetryScalar::SetMaximum(aName, aKey, aVal, aCx);
 }
 
 NS_IMETHODIMP
-TelemetryImpl::SnapshotKeyedScalars(unsigned int aDataset, bool aClearScalars, JSContext* aCx,
-                                    uint8_t optional_argc, JS::MutableHandleValue aResult)
-{
-  return TelemetryScalar::CreateKeyedSnapshots(aDataset, aClearScalars, aCx, optional_argc,
-                                               aResult, false,
-                                               NS_LITERAL_CSTRING("main"));
-}
-
-NS_IMETHODIMP
 TelemetryImpl::RegisterScalars(const nsACString& aCategoryName,
                                JS::Handle<JS::Value> aScalarData,
                                JSContext* cx)
 {
   return TelemetryScalar::RegisterScalars(aCategoryName, aScalarData, false, cx);
 }
 
 NS_IMETHODIMP
--- a/toolkit/components/telemetry/core/nsITelemetry.idl
+++ b/toolkit/components/telemetry/core/nsITelemetry.idl
@@ -111,35 +111,16 @@ interface nsITelemetry : nsISupports
    * @param aFilterTest If true, `telemetry.test` scalars will be filtered out.
                         Filtered scalars are still cleared if `aClearStore` is true.
    *                    Defaults to false.
    */
   [implicit_jscontext]
   jsval getSnapshotForKeyedScalars(in ACString aStoreName, in boolean aClearStore, [optional] in boolean aFilterTest);
 
   /**
-   * Serializes the histograms from the given dataset to a JSON-style object.
-   * The returned structure looks like:
-   *   { "process": { "name1": histogramData1, "name2": histogramData2 }, ... }
-   *
-   * Each histogram is represented in a packed format and has the following properties:
-   *   bucket_count - Number of buckets of this histogram
-   *   histogram_type - HISTOGRAM_EXPONENTIAL, HISTOGRAM_LINEAR, HISTOGRAM_BOOLEAN,
-   *                    HISTOGRAM_FLAG, HISTOGRAM_COUNT, or HISTOGRAM_CATEGORICAL
-   *   sum - sum of the bucket contents
-   *   range - A 2-item array of minimum and maximum bucket size
-   *   values - Map from bucket to the bucket's count
-   *
-   * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
-   * @param aClear Whether to clear out the histograms after snapshotting
-   */
-  [implicit_jscontext]
-  jsval snapshotHistograms(in uint32_t aDataset, in boolean aClear);
-
-  /**
    * The amount of time, in milliseconds, that the last session took
    * to shutdown.  Reads as 0 to indicate failure.
    */
   readonly attribute uint32_t lastShutdownDuration;
 
   /**
    * The number of failed profile lock attempts that have occurred prior to
    * successfully locking the profile
@@ -288,27 +269,16 @@ interface nsITelemetry : nsISupports
    *   clear([optional] {store}) - Zeros out the histogram's buckets and sum.
                                    Defaults to the "main" store.
                                    Note: This is intended to be only used in tests.
    */
   [implicit_jscontext]
   jsval getHistogramById(in ACString id);
 
   /**
-   * Serializes the keyed histograms from the given dataset to a JSON-style object.
-   * The returned structure looks like:
-   *   { process1: {name1: {histogramData1}, name2:{histogramData2}...}}
-   *
-   * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
-   * @param aClear Whether to clear out the keyed histograms after snapshotting
-   */
-  [implicit_jscontext]
-  jsval snapshotKeyedHistograms(in uint32_t aDataset, in boolean aClear);
-
-  /**
    * Create and return a histogram registered in TelemetryHistograms.h.
    *
    * @param id - unique identifier from TelemetryHistograms.h
    * The returned object has the following functions:
    *   add(string key, [optional] int) - Add an int value to the histogram for that key.
                                          If no histogram for that key exists yet, it is created.
    *   snapshot([optional] {store}) - Returns the snapshots of all the registered keys in the form
                                       {key1: snapshot1, key2: snapshot2, ...} in the specified store.
@@ -445,27 +415,16 @@ interface nsITelemetry : nsISupports
    *
    * @param aName The scalar name.
    * @param aValue The numeric value to set the scalar to. Only unsigned integers supported.
    */
   [implicit_jscontext]
   void scalarSetMaximum(in ACString aName, in jsval aValue);
 
   /**
-   * Serializes the scalars from the given dataset to a JSON-style object and resets them.
-   * The returned structure looks like:
-   *   {"process": {"category1.probe":1,"category1.other_probe":false,...}, ... }.
-   *
-   * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
-   * @param [aClear=false] Whether to clear out the scalars after snapshotting.
-   */
-  [implicit_jscontext, optional_argc]
-  jsval snapshotScalars(in uint32_t aDataset, [optional] in boolean aClear);
-
-  /**
    * Adds the value to the given keyed scalar.
    *
    * @param aName The scalar name.
    * @param aKey The key name.
    * @param aValue The numeric value to add to the scalar. Only unsigned integers supported.
    */
   [implicit_jscontext]
   void keyedScalarAdd(in ACString aName, in AString aKey, in jsval aValue);
@@ -487,28 +446,16 @@ interface nsITelemetry : nsISupports
    * @param aName The scalar name.
    * @param aKey The key name.
    * @param aValue The numeric value to set the scalar to. Only unsigned integers supported.
    */
   [implicit_jscontext]
   void keyedScalarSetMaximum(in ACString aName, in AString aKey, in jsval aValue);
 
   /**
-   * Serializes the keyed scalars from the given dataset to a JSON-style object and
-   * resets them.
-   * The returned structure looks like:
-   *   { "process": { "category1.probe": { "key_1": 2, "key_2": 1, ... }, ... }, ... }
-   *
-   * @param aDataset DATASET_RELEASE_CHANNEL_OPTOUT or DATASET_RELEASE_CHANNEL_OPTIN.
-   * @param [aClear=false] Whether to clear out the scalars after snapshotting.
-   */
-  [implicit_jscontext, optional_argc]
-  jsval snapshotKeyedScalars(in uint32_t aDataset, [optional] in boolean aClear);
-
-  /**
    * Resets all the stored scalars. This is intended to be only used in tests.
    */
   void clearScalars();
 
   /**
    * Immediately sends any Telemetry batched on this process to the parent
    * process. This is intended only to be used on process shutdown.
    */