Bug 1248435 - Add telemetry probes for reload addon installation and reload action. r=jryans data-review=bsmedberg
authorAlexandre Poirot <poirot.alex@gmail.com>
Wed, 02 Mar 2016 02:32:05 -0800
changeset 322749 69b8d739ddae4447e7bac8545b90fe69a6c8ff66
parent 322748 dfd6deee384cd99161a9dfd84afed9fb5b97a4ac
child 322750 c2221861125f73dac5c76a547a15291ea2020596
push id5913
push userjlund@mozilla.com
push dateMon, 25 Apr 2016 16:57:49 +0000
treeherdermozilla-beta@dcaf0a6fa115 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjryans
bugs1248435
milestone47.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1248435 - Add telemetry probes for reload addon installation and reload action. r=jryans data-review=bsmedberg
devtools/bootstrap.js
devtools/client/shared/telemetry.js
toolkit/components/telemetry/Histograms.json
--- a/devtools/bootstrap.js
+++ b/devtools/bootstrap.js
@@ -3,16 +3,23 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
 const Cu = Components.utils;
 const Ci = Components.interfaces;
 const {Services} = Cu.import("resource://gre/modules/Services.jsm", {});
 
+function actionOccurred(id) {
+  let {require} = Cu.import("resource://devtools/shared/Loader.jsm", {});
+  let Telemetry = require("devtools/client/shared/telemetry");;
+  let telemetry = new Telemetry();
+  telemetry.actionOccurred(id);
+}
+
 // Helper to listen to a key on all windows
 function MultiWindowKeyListener({ keyCode, ctrlKey, altKey, callback }) {
   let keyListener = function (event) {
     if (event.ctrlKey == !!ctrlKey &&
         event.altKey == !!altKey &&
         event.keyCode === keyCode) {
       callback(event);
 
@@ -145,25 +152,29 @@ function reload(event) {
     let {setTimeout} = Cu.import("resource://gre/modules/Timer.jsm", {});
     setTimeout(() => {
       let { TargetFactory } = devtools.require("devtools/client/framework/target");
       let { gDevTools } = devtools.require("devtools/client/framework/devtools");
       let target = TargetFactory.forTab(top.gBrowser.selectedTab);
       gDevTools.showToolbox(target);
     }, 1000);
   }
+
+  actionOccurred("reloadAddonReload");
 }
 
 let listener;
 function startup() {
   dump("DevTools addon started.\n");
   listener = new MultiWindowKeyListener({
     keyCode: Ci.nsIDOMKeyEvent.DOM_VK_R, ctrlKey: true, altKey: true,
     callback: reload
   });
   listener.start();
 }
 function shutdown() {
   listener.stop();
   listener = null;
 }
-function install() {}
+function install() {
+  actionOccurred("reloadAddonInstalled");
+}
 function uninstall() {}
--- a/devtools/client/shared/telemetry.js
+++ b/devtools/client/shared/telemetry.js
@@ -228,17 +228,25 @@ Telemetry.prototype = {
     webideImportProject: {
       histogram: "DEVTOOLS_WEBIDE_IMPORT_PROJECT_COUNT",
       userHistogram: "DEVTOOLS_WEBIDE_IMPORT_PROJECT_PER_USER_FLAG",
     },
     custom: {
       histogram: "DEVTOOLS_CUSTOM_OPENED_COUNT",
       userHistogram: "DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG",
       timerHistogram: "DEVTOOLS_CUSTOM_TIME_ACTIVE_SECONDS"
-    }
+    },
+    reloadAddonInstalled: {
+      histogram: "DEVTOOLS_RELOAD_ADDON_INSTALLED_COUNT",
+      userHistogram: "DEVTOOLS_RELOAD_ADDON_INSTALLED_PER_USER_FLAG",
+    },
+    reloadAddonReload: {
+      histogram: "DEVTOOLS_RELOAD_ADDON_RELOAD_COUNT",
+      userHistogram: "DEVTOOLS_RELOAD_ADDON_RELOAD_PER_USER_FLAG",
+    },
   },
 
   /**
    * Add an entry to a histogram.
    *
    * @param  {String} id
    *         Used to look up the relevant histogram ID and log true to that
    *         histogram.
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -7016,16 +7016,30 @@
   "DEVTOOLS_CUSTOM_OPENED_COUNT": {
     "alert_emails": ["dev-developer-tools@lists.mozilla.org"],
     "expires_in_version": "never",
     "kind": "count",
     "bug_numbers": [1247985],
     "description": "Number of times a custom developer tool has been opened.",
     "releaseChannelCollection": "opt-out"
   },
+  "DEVTOOLS_RELOAD_ADDON_INSTALLED_COUNT": {
+    "alert_emails": ["dev-developer-tools@lists.mozilla.org"],
+    "expires_in_version": "55",
+    "kind": "count",
+    "description": "Number of times the reload addon has been installed.",
+    "bug_numbers": [1248435]
+  },
+  "DEVTOOLS_RELOAD_ADDON_RELOAD_COUNT": {
+    "alert_emails": ["dev-developer-tools@lists.mozilla.org"],
+    "expires_in_version": "55",
+    "kind": "count",
+    "description": "Number of times the tools have been reloaded by the reload addon.",
+    "bug_numbers": [1248435]
+  },
   "DEVTOOLS_TOOLBOX_OPENED_PER_USER_FLAG": {
     "expires_in_version": "never",
     "kind": "flag",
     "description": "Number of users that have opened the DevTools toolbox."
   },
   "DEVTOOLS_OPTIONS_OPENED_PER_USER_FLAG": {
     "expires_in_version": "never",
     "kind": "flag",
@@ -7199,16 +7213,30 @@
     "kind": "flag",
     "description": "Number of users that have imported a project into the DevTools WebIDE."
   },
   "DEVTOOLS_CUSTOM_OPENED_PER_USER_FLAG": {
     "expires_in_version": "never",
     "kind": "flag",
     "description": "Number of users that have opened a custom developer tool via the toolbox button."
   },
+  "DEVTOOLS_RELOAD_ADDON_INSTALLED_PER_USER_FLAG": {
+    "alert_emails": ["dev-developer-tools@lists.mozilla.org"],
+    "expires_in_version": "55",
+    "kind": "flag",
+    "description": "Records once per browser version if the reload add-on is installed.",
+    "bug_numbers": [1248435]
+  },
+  "DEVTOOLS_RELOAD_ADDON_RELOAD_PER_USER_FLAG": {
+    "alert_emails": ["dev-developer-tools@lists.mozilla.org"],
+    "expires_in_version": "55",
+    "kind": "flag",
+    "description": "Records once per browser version if the tools have been reloaded via the reload add-on.",
+    "bug_numbers": [1248435]
+  },
   "DEVTOOLS_TOOLBOX_TIME_ACTIVE_SECONDS": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000000,
     "n_buckets": 100,
     "description": "How long has the toolbox been active (seconds)"
   },
   "DEVTOOLS_OPTIONS_TIME_ACTIVE_SECONDS": {