Bug 1448061 - Improve accuracy of devtools entry points telemetry r=jdescottes

MozReview-Commit-ID: GmXQktPew5B

--HG--
extra : rebase_source : 5209ee98a1192154dea95f139481941e01d2ae67
This commit is contained in:
Mike Ratcliffe 2018-03-22 16:53:23 +00:00
Родитель a6190a3d86
Коммит c1bd6c3abe
3 изменённых файлов: 21 добавлений и 15 удалений

Просмотреть файл

@ -153,7 +153,7 @@ this.DevToolsShim = {
return;
}
this.initDevTools();
this.initDevTools("SessionRestore");
this._gDevTools.restoreDevToolsSession(session);
},

Просмотреть файл

@ -273,7 +273,7 @@ DevToolsStartup.prototype = {
if (Services.prefs.getBoolPref(TOOLBAR_VISIBLE_PREF, false)) {
// Loading devtools-browser will open the developer toolbar by also checking this
// pref.
this.initDevTools();
this.initDevTools("DeveloperToolbar");
}
// This listener is called for all Firefox windows, but we want to execute some code
@ -612,18 +612,7 @@ DevToolsStartup.prototype = {
return null;
}
if (reason && !this.recorded) {
// Only save the first call for each firefox run as next call
// won't necessarely start the tool. For example key shortcuts may
// only change the currently selected tool.
try {
Services.telemetry.getHistogramById("DEVTOOLS_ENTRY_POINT")
.add(reason);
} catch (e) {
dump("DevTools telemetry entry point failed: " + e + "\n");
}
this.recorded = true;
}
this.sendEntryPointTelemetry(reason);
this.initialized = true;
let { require } = ChromeUtils.import("resource://devtools/shared/Loader.jsm", {});
@ -750,6 +739,8 @@ DevToolsStartup.prototype = {
Services.obs.addObserver(observe, "devtools-thread-resumed");
}
this.sendEntryPointTelemetry("CommandLine");
const { BrowserToolboxProcess } = ChromeUtils.import("resource://devtools/client/framework/ToolboxProcess.jsm", {});
BrowserToolboxProcess.init();
@ -834,6 +825,21 @@ DevToolsStartup.prototype = {
}
},
sendEntryPointTelemetry(reason) {
if (reason && !this.recorded) {
// Only save the first call for each firefox run as next call
// won't necessarely start the tool. For example key shortcuts may
// only change the currently selected tool.
try {
Services.telemetry.getHistogramById("DEVTOOLS_ENTRY_POINT")
.add(reason);
} catch (e) {
dump("DevTools telemetry entry point failed: " + e + "\n");
}
this.recorded = true;
}
},
// Used by tests and the toolbox to register the same key shortcuts in toolboxes loaded
// in a window window.
get KeyShortcuts() {

Просмотреть файл

@ -9294,7 +9294,7 @@
"alert_emails": ["dev-developer-tools@lists.mozilla.org", "apoirot@mozilla.com"],
"expires_in_version": "never",
"kind": "categorical",
"labels": ["KeyShortcut", "SystemMenu", "HamburgerMenu", "ContextMenu", "CommandLine"],
"labels": ["KeyShortcut", "SystemMenu", "HamburgerMenu", "ContextMenu", "CommandLine", "DeveloperToolbar", "SessionRestore"],
"releaseChannelCollection": "opt-out",
"description": "Records how the user is triggering Developer Tools startup."
},