From df2c8a1191dee48eb3f076fb863681e626916118 Mon Sep 17 00:00:00 2001 From: Chris H-C Date: Thu, 4 Apr 2019 13:40:08 +0000 Subject: [PATCH] Bug 1538245 - Remove test prio data from "main" ping. r=janerik,rhelmer The Prio pilot project has completed, so we no longer need to add prio-encoded payloads to the "main" ping. Differential Revision: https://phabricator.services.mozilla.com/D26004 --HG-- extra : moz-landing-system : lando --- browser/app/profile/firefox.js | 4 -- modules/libpref/init/all.js | 2 - .../telemetry/docs/data/main-ping.rst | 19 ------- .../telemetry/pings/TelemetrySession.jsm | 53 ------------------- .../components/telemetry/tests/unit/head.js | 5 -- .../tests/unit/test_TelemetrySession.js | 34 ------------ 6 files changed, 117 deletions(-) diff --git a/browser/app/profile/firefox.js b/browser/app/profile/firefox.js index b5b592b10ae0..6eaf23446a27 100644 --- a/browser/app/profile/firefox.js +++ b/browser/app/profile/firefox.js @@ -1814,10 +1814,6 @@ pref("prio.publicKeyB", "26E6674E65425B823F1F1D5F96E3BB3EF9E406EC7FBA7DEF8B08A35 // Coverage ping is disabled by default. pref("toolkit.coverage.enabled", false); pref("toolkit.coverage.endpoint.base", "https://coverage.mozilla.org"); -// Whether or not Prio-encoded Telemetry will be sent along with the main ping. -#if defined(NIGHTLY_BUILD) -pref("prio.enabled", true); -#endif // Whether Prio-encoded Telemetry will be sent in the prio ping. #if defined(NIGHTLY_BUILD) pref("toolkit.telemetry.prioping.enabled", true); diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index ecf1720c9715..bbb1f0667d6a 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -6067,8 +6067,6 @@ pref("dom.datatransfer.mozAtAPIs", false); pref("dom.datatransfer.mozAtAPIs", true); #endif -// Whether or not Prio is supported on this platform. -pref("prio.enabled", false); // Whether or not the Prio Ping is supported on this platform. pref("toolkit.telemetry.prioping.enabled", false); diff --git a/toolkit/components/telemetry/docs/data/main-ping.rst b/toolkit/components/telemetry/docs/data/main-ping.rst index 6662cb8b2bfc..27694a4d7df3 100644 --- a/toolkit/components/telemetry/docs/data/main-ping.rst +++ b/toolkit/components/telemetry/docs/data/main-ping.rst @@ -669,25 +669,6 @@ Structure: ... ], -Prio ----- -This section contains experimental data encoded with a basic version of the Prio system for private aggregation. -See `the Prio paper `_ and `the libprio Github repo `_ -for more information. - -Prio splits data packets into two "shares", signed for different servers that will do the decryption and -aggregation. We call these "Server A" and "Server B", represented as `a` and `b` keys in `payload.prio`. - -Structure: - -.. code-block:: js - - "prio": { - a: [...], - b: [...] - } - - Version History --------------- diff --git a/toolkit/components/telemetry/pings/TelemetrySession.jsm b/toolkit/components/telemetry/pings/TelemetrySession.jsm index 94043e0aecb4..977a2bc68291 100644 --- a/toolkit/components/telemetry/pings/TelemetrySession.jsm +++ b/toolkit/components/telemetry/pings/TelemetrySession.jsm @@ -72,9 +72,6 @@ const IDLE_TIMEOUT_SECONDS = Services.prefs.getIntPref("toolkit.telemetry.idleTi // in case of aborted sessions (currently 5 minutes). const ABORTED_SESSION_UPDATE_INTERVAL_MS = 5 * 60 * 1000; -// Control whether Telemetry data should be encrypted with Prio. -const PRIO_ENABLED_PREF = "prio.enabled"; - var gWasDebuggerAttached = false; XPCOMUtils.defineLazyServiceGetters(this, { @@ -98,7 +95,6 @@ var Policy = { generateSubsessionUUID: () => generateUUID(), setSchedulerTickTimeout: (callback, delayMs) => setTimeout(callback, delayMs), clearSchedulerTickTimeout: id => clearTimeout(id), - prioEncode: (batchID, prioParams) => PrioEncoder.encode(batchID, prioParams), }; /** @@ -953,11 +949,6 @@ var Impl = { payloadObj.info = info; - // Collect Prio-encoded measurements. - if (Services.prefs.getBoolPref(PRIO_ENABLED_PREF, false)) { - payloadObj.prio = protect(() => this._prioEncode(payloadObj)); - } - // Add extended set measurements for chrome process. if (Telemetry.canRecordExtended) { payloadObj.slowSQL = protect(() => Telemetry.slowSQL); @@ -1575,48 +1566,4 @@ var Impl = { this._newProfilePingSent = true; return TelemetryStorage.saveSessionData(this._getSessionDataObject()); }, - - /** - * Encodes data for experimental Prio pilot project. - * - * @param {Object} measurements - measurements taken until now. Histograms will have been cleared if - * this is a subsession, so use this to get the correct values. - * @return {Object} An object containing Prio-encoded data. - */ - _prioEncode(payloadObj) { - // First, map the Telemetry histogram names to the params PrioEncoder expects. - const prioEncodedHistograms = [ - "BROWSER_IS_USER_DEFAULT", - "NEWTAB_PAGE_ENABLED", - "PDF_VIEWER_USED", - ]; - - // Build list of Prio parameters, using the first value recorded in each histogram. - let prioParams = { booleans: [] }; - for (const [i, histogramName] of prioEncodedHistograms.entries()) { - try { - if (histogramName in payloadObj.histograms) { - const histogram = payloadObj.histograms[histogramName]; - prioParams.booleans[i] = Boolean(histogram.sum); - } else { - prioParams.booleans[i] = false; - } - } catch (ex) { - this._log.error(ex); - } - } - - // Prio encode the data and add to payload. - const batchID = Services.appinfo.appBuildID; - - let prioEncodedData; - - try { - prioEncodedData = Policy.prioEncode(batchID, prioParams); - } catch (ex) { - this._log.error(ex); - } - - return prioEncodedData; - }, }; diff --git a/toolkit/components/telemetry/tests/unit/head.js b/toolkit/components/telemetry/tests/unit/head.js index 7a8332863362..7febf49c1fa4 100644 --- a/toolkit/components/telemetry/tests/unit/head.js +++ b/toolkit/components/telemetry/tests/unit/head.js @@ -336,11 +336,6 @@ function fakeGzipCompressStringForNextPing(length) { }; } -function fakePrioEncode() { - const m = ChromeUtils.import("resource://gre/modules/TelemetrySession.jsm", null); - m.Policy.prioEncode = (batchID, prioParams) => prioParams; -} - function fakeIntlReady() { const m = ChromeUtils.import("resource://gre/modules/TelemetryEnvironment.jsm", null); m.Policy._intlLoaded = true; diff --git a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js index f1c869828a35..180bd076189e 100644 --- a/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js +++ b/toolkit/components/telemetry/tests/unit/test_TelemetrySession.js @@ -400,10 +400,6 @@ function checkPayload(payload, reason, successfulPings) { Assert.ok("processes" in payload, "The payload must have a processes section."); Assert.ok("parent" in payload.processes, "There must be at least a parent process."); - if (Services.prefs.getBoolPref("prio.enabled", false)) { - Assert.ok("prio" in payload, "The payload must have a prio section."); - } - checkScalars(payload.processes); } @@ -932,36 +928,6 @@ add_task(async function test_environmentChange() { gMonotonicNow = fakeMonotonicNow(gMonotonicNow + 10 * MILLISECONDS_PER_MINUTE); now = fakeNow(futureDate(now, 10 * MILLISECONDS_PER_MINUTE)); - if (Services.prefs.getBoolPref("prio.enabled", false)) { - fakePrioEncode(); - - // Set histograms to expected state. - let prioMeasures = [ - "BROWSER_IS_USER_DEFAULT", - "NEWTAB_PAGE_ENABLED", - ]; - - for (let measure of prioMeasures) { - const value = Telemetry.getHistogramById(measure); - value.clear(); - value.add(1); - } - - let expectedPrioResult = { - "booleans": [ - true, - true, - false, - ], - }; - - Preferences.set(PREF_TEST, 3); - ping = await PingServer.promiseNextPing(); - Assert.ok(!!ping); - - Assert.deepEqual(ping.payload.prio, expectedPrioResult); - } - await TelemetryController.testShutdown(); });