Bug 1281220 - Remove about:accounts telemetry on Fennec. r=liuche, a=ritu
authorSebastian Kaspari <s.kaspari@gmail.com>
Tue, 23 Aug 2016 16:25:19 +0200
changeset 333024 27b3a5123d75480bf02b77120425ef94c83ab022
parent 333023 d73c5a331a0f70ab1cc38a3b85314ef2c85dd2b6
child 333025 075cbb79ee62e34a14eee27e895049606f8d0eda
push id9975
push userryanvm@gmail.com
push dateFri, 02 Sep 2016 01:47:46 +0000
treeherdermozilla-aurora@d76058fbf56f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersliuche, ritu
bugs1281220
milestone50.0a2
Bug 1281220 - Remove about:accounts telemetry on Fennec. r=liuche, a=ritu MozReview-Commit-ID: GTKaauQIDKo
mobile/android/chrome/content/aboutAccounts.js
mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testBug1217581.java
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/mobile/android/chrome/content/aboutAccounts.js
+++ b/mobile/android/chrome/content/aboutAccounts.js
@@ -59,101 +59,59 @@ function show(id) {
 }
 
 // Each time we try to load the remote <iframe>, loadedDeferred is replaced.  It
 // is resolved by a LOADED message, and rejected by a failure to load.
 var loadedDeferred = null;
 
 // We have a new load starting.  Replace the existing promise with a new one,
 // and queue up the transition to remote content.
-function deferTransitionToRemoteAfterLoaded(url) {
+function deferTransitionToRemoteAfterLoaded() {
   log.d('Waiting for LOADED message.');
 
-  // We are collecting data to understand the experience when using
-  // about:accounts to connect to the specific fxa-content-server hosted by
-  // Mozilla at accounts.firefox.com.  However, we don't want to observe what
-  // alternate servers users might be using, so we can't collect the whole URL.
-  // Here, we filter the data based on whether the user is /not/ using
-  // accounts.firefox.com, and then record just the endpoint path.  Other
-  // collected data could expose that the user is using Firefox Accounts, and
-  // together, that leaks the number of users not using accounts.firefox.com.
-  // We accept this leak: Mozilla already collects data about whether Sync (both
-  // legacy and FxA) is using a custom server in various situations: see the
-  // WEAVE_CUSTOM_* Telemetry histograms.
-  let recordResultTelemetry; // Defined only when not customized.
-  let isCustomized = Services.prefs.prefHasUserValue("identity.fxaccounts.remote.webchannel.uri");
-  if (!isCustomized) {
-    // Turn "https://accounts.firefox.com/settings?context=fx_fennec_v1&email=EMAIL" into "/settings".
-    let key = Services.io.newURI(url, null, null).path.split("?")[0];
-
-    let startTime = Cu.now();
-
-    let start = Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT');
-    start.add(key);
-
-    recordResultTelemetry = function(success) {
-      let rate = Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_RATE');
-      rate.add(key, success);
-
-      // We would prefer to use TelemetryStopwatch, but it doesn't yet support
-      // keyed histograms (see Bug 1205898).  So we measure and store ourselves.
-      let delta = Cu.now() - startTime; // Floating point milliseconds, microsecond precision.
-      let time = success ?
-            Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_TIME_MS') :
-            Services.telemetry.getKeyedHistogramById('ABOUT_ACCOUNTS_CONTENT_SERVER_FAILURE_TIME_MS');
-      time.add(key, Math.round(delta));
-    };
-  }
-
   loadedDeferred = PromiseUtils.defer();
   loadedDeferred.promise.then(() => {
     log.d('Got LOADED message!');
     document.getElementById("remote").style.opacity = 0;
     show("remote");
     document.getElementById("remote").style.opacity = 1;
-    if (!isCustomized) {
-      recordResultTelemetry(true);
-    }
   })
   .catch((e) => {
     log.w('Did not get LOADED message: ' + e.toString());
-    if (!isCustomized) {
-      recordResultTelemetry(false);
-    }
   });
 }
 
 function handleLoadedMessage(message) {
   loadedDeferred.resolve();
 };
 
 var wrapper = {
   iframe: null,
 
   url: null,
 
   init: function (url) {
     this.url = url;
-    deferTransitionToRemoteAfterLoaded(this.url);
+    deferTransitionToRemoteAfterLoaded();
 
     let iframe = document.getElementById("remote");
     this.iframe = iframe;
     this.iframe.QueryInterface(Ci.nsIFrameLoaderOwner);
     let docShell = this.iframe.frameLoader.docShell;
     docShell.QueryInterface(Ci.nsIWebProgress);
     docShell.addProgressListener(this.iframeListener, Ci.nsIWebProgress.NOTIFY_STATE_DOCUMENT);
 
     // Set the iframe's location with loadURI/LOAD_FLAGS_BYPASS_HISTORY to
     // avoid having a new history entry being added.
     let webNav = iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
   },
 
   retry: function () {
-    deferTransitionToRemoteAfterLoaded(this.url);
+    deferTransitionToRemoteAfterLoaded();
 
     let webNav = this.iframe.frameLoader.docShell.QueryInterface(Ci.nsIWebNavigation);
     webNav.loadURI(this.url, Ci.nsIWebNavigation.LOAD_FLAGS_BYPASS_HISTORY, null, null, null);
   },
 
   iframeListener: {
     QueryInterface: XPCOMUtils.generateQI([Ci.nsIWebProgressListener,
                                          Ci.nsISupportsWeakReference,
--- a/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testBug1217581.java
+++ b/mobile/android/tests/browser/robocop/src/org/mozilla/gecko/tests/testBug1217581.java
@@ -6,17 +6,17 @@
 package org.mozilla.gecko.tests;
 
 
 import org.mozilla.gecko.Telemetry;
 
 public class testBug1217581 extends BaseTest {
     // Take arbitrary histogram names used by Fennec.
     private static final String TEST_HISTOGRAM_NAME = "FENNEC_SYNC_NUMBER_OF_SYNCS_COMPLETED";
-    private static final String TEST_KEYED_HISTOGRAM_NAME = "ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT";
+    private static final String TEST_KEYED_HISTOGRAM_NAME = "FX_MIGRATION_ERRORS";
     private static final String TEST_KEY_NAME = "testBug1217581";
 
 
     public void testBug1217581() {
         blockForGeckoReady();
 
         mAsserter.ok(true, "Checking that adding to a keyed histogram then adding to a normal histogram does not cause a crash.", "");
         Telemetry.addToKeyedHistogram(TEST_KEYED_HISTOGRAM_NAME, TEST_KEY_NAME, 1);
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -8597,48 +8597,16 @@
     "kind": "count",
     "description": "Counts the number of times that a sync has failed with errors."
   },
   "FENNEC_SYNC_NUMBER_OF_SYNCS_FAILED_BACKOFF": {
     "expires_in_version": "45",
     "kind": "count",
     "description": "Counts the number of times that a sync has failed because of trying to sync before server backoff interval has passed."
   },
-  "ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT": {
-    "alert_emails": ["mobile-frontend@mozilla.com"],
-    "expires_in_version": "50",
-    "kind": "count",
-    "keyed": true,
-    "description": "The number of remote content loads started. Keyed on fxa-content-server endpoint, like '/signin' or '/settings'."
-  },
-  "ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_RATE": {
-    "alert_emails": ["mobile-frontend@mozilla.com"],
-    "expires_in_version": "50",
-    "kind": "boolean",
-    "keyed": true,
-    "description": "The number of remote content loads that fail (0) vs. receive the remote 'LOADED' message (1). Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
-  },
-  "ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_TIME_MS": {
-    "alert_emails": ["mobile-frontend@mozilla.com"],
-    "expires_in_version": "50",
-    "keyed": true,
-    "kind": "exponential",
-    "high": 60000,
-    "n_buckets": 50,
-    "description": "The length of time (in milliseconds) between starting remote content load and receiving the remote 'LOADED' message. Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
-  },
-  "ABOUT_ACCOUNTS_CONTENT_SERVER_FAILURE_TIME_MS": {
-    "alert_emails": ["mobile-frontend@mozilla.com"],
-    "expires_in_version": "50",
-    "keyed": true,
-    "kind": "exponential",
-    "high": 60000,
-    "n_buckets": 50,
-    "description": "The length of time (in milliseconds) between starting remote content load and failing with a connection error. Keyed on fxa-content-server endpoint path, like '/signin' or '/settings'."
-  },
   "SLOW_SCRIPT_NOTICE_COUNT": {
     "alert_emails": ["perf-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "count",
     "description": "Count slow script notices"
   },
   "SLOW_SCRIPT_PAGE_COUNT": {
     "alert_emails": ["perf-telemetry-alerts@mozilla.com"],
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -992,20 +992,16 @@
     "XUL_CACHE_DISABLED"
   ],
   "bug_numbers": [
     "A11Y_CONSUMERS",
     "A11Y_IATABLE_USAGE_FLAG",
     "A11Y_INSTANTIATED_FLAG",
     "A11Y_ISIMPLEDOM_USAGE_FLAG",
     "A11Y_UPDATE_TIME",
-    "ABOUT_ACCOUNTS_CONTENT_SERVER_FAILURE_TIME_MS",
-    "ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_RATE",
-    "ABOUT_ACCOUNTS_CONTENT_SERVER_LOADED_TIME_MS",
-    "ABOUT_ACCOUNTS_CONTENT_SERVER_LOAD_STARTED_COUNT",
     "ADDON_SHIM_USAGE",
     "APPLICATION_REPUTATION_COUNT",
     "APPLICATION_REPUTATION_LOCAL",
     "APPLICATION_REPUTATION_SERVER",
     "APPLICATION_REPUTATION_SHOULD_BLOCK",
     "AUDIOSTREAM_FIRST_OPEN_MS",
     "AUDIOSTREAM_LATER_OPEN_MS",
     "AUTO_REJECTED_TRANSLATION_OFFERS",