Bug 1357146 - Remove BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS telemetry. r?jaws draft
authorDimiL <dlee@mozilla.com>
Tue, 06 Jun 2017 09:35:00 +0800
changeset 589349 ae1bfc26c4834e571cfc0d4249b6e909520a9cae
parent 589301 2c6289f56812c30254acfdddabcfec1e149c0336
child 631852 62984cadcaca09064f7fdc1b647f772289cb3419
push id62343
push userbmo:dlee@mozilla.com
push dateTue, 06 Jun 2017 03:51:23 +0000
reviewersjaws
bugs1357146
milestone55.0a1
Bug 1357146 - Remove BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS telemetry. r?jaws MozReview-Commit-ID: JMmYqA0TAIb
browser/components/nsBrowserGlue.js
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -2485,18 +2485,16 @@ ContentPermissionPrompt.prototype = {
       request.cancel();
       throw ex;
     }
   },
 };
 
 var DefaultBrowserCheck = {
   get OPTIONPOPUP() { return "defaultBrowserNotificationPopup" },
-  _setAsDefaultTimer: null,
-  _setAsDefaultButtonClickStartTime: 0,
 
   closePrompt(aNode) {
     if (this._notification) {
       this._notification.close();
     }
   },
 
   setAsDefault() {
@@ -2509,43 +2507,16 @@ var DefaultBrowserCheck = {
         // only show the protocol association screen on Windows 8+.
         // Windows 8 is version 6.2.
         let version = Services.sysinfo.getProperty("version");
         claimAllTypes = (parseFloat(version) < 6.2);
       } catch (ex) { }
     }
     try {
       ShellService.setDefaultBrowser(claimAllTypes, false);
-
-      if (this._setAsDefaultTimer) {
-        this._setAsDefaultTimer.cancel();
-      }
-
-      this._setAsDefaultButtonClickStartTime = Math.floor(Date.now() / 1000);
-      this._setAsDefaultTimer = Cc["@mozilla.org/timer;1"].createInstance(Ci.nsITimer);
-      this._setAsDefaultTimer.init(() => {
-        let isDefault = false;
-        let isDefaultError = false;
-        try {
-          isDefault = ShellService.isDefaultBrowser(true, false);
-        } catch (ex) {
-          isDefaultError = true;
-        }
-
-        let now = Math.floor(Date.now() / 1000);
-        let runTime = now - this._setAsDefaultButtonClickStartTime;
-        if (isDefault || runTime > 600) {
-          this._setAsDefaultTimer.cancel();
-          this._setAsDefaultTimer = null;
-          Services.telemetry.getHistogramById("BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS")
-                            .add(runTime);
-        }
-        Services.telemetry.getHistogramById("BROWSER_IS_USER_DEFAULT_ERROR")
-                          .add(isDefaultError);
-      }, 1000, Ci.nsITimer.TYPE_REPEATING_SLACK);
     } catch (ex) {
       setAsDefaultError = true;
       Cu.reportError(ex);
     }
     // Here BROWSER_IS_USER_DEFAULT and BROWSER_SET_USER_DEFAULT_ERROR appear
     // to be inverse of each other, but that is only because this function is
     // called when the browser is set as the default. During startup we record
     // the BROWSER_IS_USER_DEFAULT value without recording BROWSER_SET_USER_DEFAULT_ERROR.
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10052,25 +10052,16 @@
   },
   "BROWSER_SET_DEFAULT_ERROR": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "boolean",
     "releaseChannelCollection": "opt-out",
     "description": "True if the browser was unable to set Firefox as the default browser"
   },
-  "BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS": {
-    "record_in_processes": ["main", "content"],
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "high": 500,
-    "n_buckets": 15,
-    "releaseChannelCollection": "opt-out",
-    "description": "Time to successfully set Firefox as the default browser after clicking 'Set Firefox as Default'. Should be near-instant in some environments, others require user interaction. Measured in seconds."
-  },
   "BROWSER_IS_ASSIST_DEFAULT": {
     "record_in_processes": ["main", "content"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "The result of the default browser check for assist intent."
   },
   "MIXED_CONTENT_PAGE_LOAD": {
     "record_in_processes": ["main", "content"],
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -13,17 +13,16 @@
     "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
     "BROWSER_IS_ASSIST_DEFAULT",
     "BROWSER_IS_USER_DEFAULT",
     "BROWSER_IS_USER_DEFAULT_ERROR",
     "BROWSER_SET_DEFAULT_ALWAYS_CHECK",
     "BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT",
     "BROWSER_SET_DEFAULT_ERROR",
     "BROWSER_SET_DEFAULT_RESULT",
-    "BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS",
     "BR_9_2_1_SUBJECT_ALT_NAMES",
     "BR_9_2_2_SUBJECT_COMMON_NAME",
     "CACHE_DEVICE_SEARCH_2",
     "CACHE_DISK_SEARCH_2",
     "CACHE_LM_INCONSISTENT",
     "CACHE_MEMORY_SEARCH_2",
     "CACHE_OFFLINE_SEARCH_2",
     "CACHE_SERVICE_LOCK_WAIT_2",
@@ -652,17 +651,16 @@
     "BROWSERPROVIDER_XUL_IMPORT_BOOKMARKS",
     "BROWSER_IS_ASSIST_DEFAULT",
     "BROWSER_IS_USER_DEFAULT",
     "BROWSER_IS_USER_DEFAULT_ERROR",
     "BROWSER_SET_DEFAULT_ALWAYS_CHECK",
     "BROWSER_SET_DEFAULT_DIALOG_PROMPT_RAWCOUNT",
     "BROWSER_SET_DEFAULT_ERROR",
     "BROWSER_SET_DEFAULT_RESULT",
-    "BROWSER_SET_DEFAULT_TIME_TO_COMPLETION_SECONDS",
     "BR_9_2_1_SUBJECT_ALT_NAMES",
     "BR_9_2_2_SUBJECT_COMMON_NAME",
     "BUCKET_ORDER_ERRORS",
     "CACHE_DEVICE_SEARCH_2",
     "CACHE_DISK_SEARCH_2",
     "CACHE_LM_INCONSISTENT",
     "CACHE_MEMORY_SEARCH_2",
     "CACHE_OFFLINE_SEARCH_2",