mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-19 16:25:38 +00:00
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
This commit is contained in:
parent
0e4c5eb310
commit
df2c8a1191
@ -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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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 <https://crypto.stanford.edu/prio/>`_ and `the libprio Github repo <https://github.com/mozilla/libprio>`_
|
||||
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
|
||||
---------------
|
||||
|
||||
|
@ -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;
|
||||
},
|
||||
};
|
||||
|
@ -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;
|
||||
|
@ -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();
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user