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
--- 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;
}