Bug 1443609 - Remove legacy components from UITelemetry r=chutten

Reporting was already disabled in Bug 1443605.

This keeps the `enabled` getter as a way to detect if it is enabled, in use in BrowserUITelemetry only.
This keeps `addEvent` and related methods, as they are still in use on Android.
This commit is contained in:
Jan-Erik Rediger 2018-04-04 07:39:00 +03:00
parent 16c5eae5e4
commit 2c31418dd5
3 changed files with 7 additions and 71 deletions

View File

@ -1,8 +1,12 @@
.. _uitelemetry:
=======================
UITelemetry data format
=======================
==================================
UITelemetry data format (obsolete)
==================================
.. note::
``UITelemetry`` is deprecated. As of Firefox 61, ``UITelemetry`` is no longer reported.
UI Telemetry sends its data as a JSON blob. This document describes the different parts
of the JSON blob.

View File

@ -11,8 +11,6 @@ ChromeUtils.import("resource://gre/modules/XPCOMUtils.jsm");
ChromeUtils.defineModuleGetter(this, "AppConstants",
"resource://gre/modules/AppConstants.jsm");
ChromeUtils.defineModuleGetter(this, "UITelemetry",
"resource://gre/modules/UITelemetry.jsm");
ChromeUtils.defineModuleGetter(this, "RecentWindow",
"resource:///modules/RecentWindow.jsm");
ChromeUtils.defineModuleGetter(this, "CustomizableUI",
@ -166,18 +164,6 @@ const BUCKET_SEPARATOR = "|";
var BrowserUITelemetry = {
init() {
UITelemetry.addSimpleMeasureFunction("toolbars",
this.getToolbarMeasures.bind(this));
UITelemetry.addSimpleMeasureFunction("contextmenu",
this.getContextMenuInfo.bind(this));
// Ensure that UITour.jsm remains lazy-loaded, yet always registers its
// simple measure function with UITelemetry.
UITelemetry.addSimpleMeasureFunction("UITour",
() => UITour.getTelemetry());
UITelemetry.addSimpleMeasureFunction("syncstate",
this.getSyncState.bind(this));
Services.obs.addObserver(this, "autocomplete-did-enter-text");
CustomizableUI.addListener(this);

View File

@ -69,13 +69,6 @@ var UITelemetry = {
return this;
},
/**
* Holds the functions that provide UITelemetry's simple
* measurements. Those functions are mapped to unique names,
* and should be registered with addSimpleMeasureFunction.
*/
_simpleMeasureFunctions: {},
/**
* A hack to generate the relative timestamp from start when we don't have
* access to the Java timer.
@ -160,53 +153,6 @@ var UITelemetry = {
this._measurements.push(aEvent);
},
/**
* Called by TelemetrySession to populate the simple measurement
* blob. This function will iterate over all functions added
* via addSimpleMeasureFunction and return an object with the
* results of those functions.
*/
getSimpleMeasures() {
if (!this.enabled) {
return {};
}
let result = {};
for (let name in this._simpleMeasureFunctions) {
result[name] = this._simpleMeasureFunctions[name]();
}
return result;
},
/**
* Allows the caller to register functions that will get called
* for simple measures during a Telemetry ping. aName is a unique
* identifier used as they key for the simple measurement in the
* object that getSimpleMeasures returns.
*
* This function throws an exception if aName already has a function
* registered for it.
*/
addSimpleMeasureFunction(aName, aFunction) {
if (!this.enabled) {
return;
}
if (aName in this._simpleMeasureFunctions) {
throw new Error("A simple measurement function is already registered for " + aName);
}
if (!aFunction || typeof aFunction !== "function") {
throw new Error("addSimpleMeasureFunction called with non-function argument.");
}
this._simpleMeasureFunctions[aName] = aFunction;
},
removeSimpleMeasureFunction(aName) {
delete this._simpleMeasureFunctions[aName];
},
/**
* Called by TelemetrySession to populate the UI measurement
* blob.