Bug 1467705 - Pack GeckoView histograms using TelemetryUtils. r?esawin draft
authorAlessio Placitelli <alessio.placitelli@gmail.com>
Fri, 08 Jun 2018 20:09:19 +0200
changeset 807508 b3a24f55ace2cc89d5e91ea08b4f80569a2dcf63
parent 807507 6f93c5128eed6ca9606998015c5f13a6b468dcaf
child 807509 d266fb81815b813df5c9ccc38b9658e87ab7dab8
child 807549 68257f81dd7f84812e73ef5ce2a65255d3ca458e
push id113131
push useralessio.placitelli@gmail.com
push dateThu, 14 Jun 2018 18:52:31 +0000
reviewersesawin
bugs1467705
milestone62.0a1
Bug 1467705 - Pack GeckoView histograms using TelemetryUtils. r?esawin Firefox Desktop uses a sparse representation for histograms and the pipeline expects them to be this way. This patch makes sure the GeckoView API returns packed histograms and keyed histograms. MozReview-Commit-ID: 3j4HdfASTSO
toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
--- a/toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
+++ b/toolkit/components/telemetry/geckoview/GeckoViewTelemetryController.jsm
@@ -88,25 +88,30 @@ const GeckoViewTelemetryController = {
   retrieveSnapshots(aClear, aCallback) {
     debug `retrieveSnapshots`;
 
     // Selecting the opt-in dataset will ensure that we retrieve opt-in probes
     // (iff canRecordPreRelease == true) and opt-out probes
     // (iff canRecordRelease == true) if they are being recorded.
     const dataset = Ci.nsITelemetry.DATASET_RELEASE_CHANNEL_OPTIN;
 
+    const rawHistograms = Services.telemetry.snapshotHistograms(dataset,
+                                                                /* subsession */ false,
+                                                                /* clear */ false);
+    const rawKeyedHistograms =
+      Services.telemetry.snapshotKeyedHistograms(dataset, /* subsession */ false,
+                                                 /* clear */ false);
+    const scalars = Services.telemetry.snapshotScalars(dataset, /* clear */ false);
+    const keyedScalars = Services.telemetry.snapshotKeyedScalars(dataset, /* clear */ false);
+
     const snapshots = {
-      histograms: Services.telemetry.snapshotHistograms(
-                      dataset, /* subsession */ false, /* clear */ false),
-      keyedHistograms: Services.telemetry.snapshotKeyedHistograms(
-                           dataset, /* subsession */ false, /* clear */ false),
-      scalars: Services.telemetry.snapshotScalars(
-                   dataset, /* clear */ false),
-      keyedScalars: Services.telemetry.snapshotKeyedScalars(
-                        dataset, /* clear */ false),
+      histograms: TelemetryUtils.packHistograms(rawHistograms),
+      keyedHistograms: TelemetryUtils.packKeyedHistograms(rawKeyedHistograms),
+      scalars,
+      keyedScalars,
     };
 
     if (!snapshots.histograms || !snapshots.keyedHistograms ||
         !snapshots.scalars || !snapshots.keyedScalars) {
       aCallback.onError(`Failed retrieving snapshots!`);
       return;
     }