Bug 1345315 - Remove obsolete tab animation telemetry. r=mconley draft
authorDão Gottwald <dao@mozilla.com>
Wed, 19 Apr 2017 11:56:24 +0200
changeset 564997 d01a488d3b89bd4b0194eaa219cceeffb2477fa9
parent 564996 a1b682b9b39d452992f86533550d8f34e61567c0
child 624881 348c63f06cefd42c403813028d8ddc3420e8e004
push id54747
push userdgottwald@mozilla.com
push dateWed, 19 Apr 2017 09:56:52 +0000
reviewersmconley
bugs1345315
milestone55.0a1
Bug 1345315 - Remove obsolete tab animation telemetry. r=mconley MozReview-Commit-ID: 2BopUnpHF8J
browser/base/content/tabbrowser.xml
toolkit/components/telemetry/Histograms.json
toolkit/components/telemetry/histogram-whitelists.json
--- a/browser/base/content/tabbrowser.xml
+++ b/browser/base/content/tabbrowser.xml
@@ -2388,21 +2388,19 @@
               else
                 t.owner = this.selectedTab;
               this.moveTabTo(t, newTabPos);
               this._lastRelatedTab = t;
             }
 
             if (animate) {
               requestAnimationFrame(function() {
-                this.tabContainer._handleTabTelemetryStart(t, aURI);
-
                 // kick the animation off
                 t.setAttribute("fadein", "true");
-              }.bind(this));
+              });
             }
 
             return t;
           ]]>
         </body>
       </method>
 
       <method name="warnAboutClosingTabs">
@@ -2610,18 +2608,16 @@
               TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_ANIM_MS", aTab);
               this._endRemoveTab(aTab);
               return;
             }
 
             // We're animating, so we can cancel the non-animation stopwatch.
             TelemetryStopwatch.cancel("FX_TAB_CLOSE_TIME_NO_ANIM_MS", aTab);
 
-            this.tabContainer._handleTabTelemetryStart(aTab);
-
             this._blurTab(aTab);
             aTab.style.maxWidth = ""; // ensure that fade-out transition happens
             aTab.removeAttribute("fadein");
 
             setTimeout(function(tab, tabbrowser) {
               if (tab.parentNode &&
                   window.getComputedStyle(tab).maxWidth == "0.1px") {
                 NS_ASSERT(false, "Giving up waiting for the tab closing animation to finish (bug 608589)");
@@ -5680,18 +5676,16 @@
 
           var tab = this.firstChild;
           tab.label = this.tabbrowser.mStringBundle.getString("tabs.emptyTabTitle");
           tab.setAttribute("onerror", "this.removeAttribute('image');");
 
           window.addEventListener("resize", this);
           window.addEventListener("load", this);
 
-          this._tabAnimationLoggingEnabled = Services.prefs.getBoolPref("browser.tabs.animationLogging.enabled", false);
-          this._browserNewtabpageEnabled = Services.prefs.getBoolPref("browser.newtabpage.enabled");
           Services.prefs.addObserver("privacy.userContext", this);
           this.observe(null, "nsPref:changed", "privacy.userContext.enabled");
         ]]>
       </constructor>
 
       <destructor>
         <![CDATA[
           Services.prefs.removeObserver("privacy.userContext", this);
@@ -6424,91 +6418,16 @@
         <parameter name="aTab"/>
         <body>
         <![CDATA[
           return !aTab.closing;
         ]]>
         </body>
       </method>
 
-      <method name="_handleTabTelemetryStart">
-        <parameter name="aTab"/>
-        <parameter name="aURI"/>
-        <body>
-        <![CDATA[
-          // Animation-smoothness telemetry/logging
-          if (Services.telemetry.canRecordExtended || this._tabAnimationLoggingEnabled) {
-            if (aURI == "about:newtab" && (aTab._tPos == 1 || aTab._tPos == 2)) {
-              // Indicate newtab page animation where other tabs are unaffected
-              // (for which case, the 2nd or 3rd tabs are good representatives, even if not absolute)
-              aTab._recordingTabOpenPlain = true;
-            }
-            aTab._recordingHandle = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                                          .getInterface(Ci.nsIDOMWindowUtils)
-                                          .startFrameTimeRecording();
-          }
-
-          // Overall animation duration
-          aTab._animStartTime = Date.now();
-        ]]>
-        </body>
-      </method>
-
-      <method name="_handleTabTelemetryEnd">
-        <parameter name="aTab"/>
-        <body>
-        <![CDATA[
-          if (!aTab._animStartTime) {
-            return;
-          }
-
-          aTab._animStartTime = 0;
-
-          // Handle tab animation smoothness telemetry/logging of frame intervals and paint times
-          if (!("_recordingHandle" in aTab)) {
-            return;
-          }
-
-          let intervals = window.QueryInterface(Ci.nsIInterfaceRequestor)
-                                .getInterface(Ci.nsIDOMWindowUtils)
-                                .stopFrameTimeRecording(aTab._recordingHandle);
-          delete aTab._recordingHandle;
-          let frameCount = intervals.length;
-
-          if (this._tabAnimationLoggingEnabled) {
-            let msg = "Tab " + (aTab.closing ? "close" : "open") + " (Frame-interval):\n";
-            for (let i = 0; i < frameCount; i++) {
-              msg += Math.round(intervals[i]) + "\n";
-            }
-            Services.console.logStringMessage(msg);
-          }
-
-          // For telemetry, the first frame interval is not useful since it may represent an interval
-          // to a relatively old frame (prior to recording start). So we'll ignore it for the average.
-          if (frameCount > 1) {
-            let averageInterval = 0;
-            for (let i = 1; i < frameCount; i++) {
-              averageInterval += intervals[i];
-            }
-            averageInterval = averageInterval / (frameCount - 1);
-
-            Services.telemetry.getHistogramById("FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS").add(averageInterval);
-
-            if (aTab._recordingTabOpenPlain) {
-              delete aTab._recordingTabOpenPlain;
-              // While we do have a telemetry probe NEWTAB_PAGE_ENABLED to monitor newtab preview, it'll be
-              // easier to overview the data without slicing by it. Hence the additional histograms with _PREVIEW.
-              let preview = this._browserNewtabpageEnabled ? "_PREVIEW" : "";
-              Services.telemetry.getHistogramById("FX_TAB_ANIM_OPEN" + preview + "_FRAME_INTERVAL_MS").add(averageInterval);
-            }
-          }
-        ]]>
-        </body>
-      </method>
-
       <method name="getRelatedElement">
         <parameter name="aTab"/>
         <body>
         <![CDATA[
           if (!aTab)
             return null;
           // If the tab's browser is lazy, we need to `_insertBrowser` in order
           // to have a linkedPanel.  This will also serve to bind the browser
@@ -6528,18 +6447,16 @@
       <handler event="TabSelect" action="this._handleTabSelect();"/>
 
       <handler event="transitionend"><![CDATA[
         if (event.propertyName != "max-width")
           return;
 
         var tab = event.target;
 
-        this._handleTabTelemetryEnd(tab);
-
         if (tab.getAttribute("fadein") == "true") {
           if (tab._fullyOpen)
             this.adjustTabstrip();
           else
             this._handleNewTab(tab);
         } else if (tab.closing) {
           this.tabbrowser._endRemoveTab(tab);
         }
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -5202,40 +5202,16 @@
     "alert_emails": ["mconley@mozilla.com", "hkirschner@mozilla.com"],
     "bug_numbers": [1340842],
     "expires_in_version": "60",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 50,
     "description": "Firefox: Time taken to run permitUnload on a browser during tab close to see whether or not we're allowed to close the tab (ms)."
   },
-  "FX_TAB_ANIM_OPEN_PREVIEW_FRAME_INTERVAL_MS": {
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "low": 7,
-    "high": 500,
-    "n_buckets": 50,
-    "description": "Average frame interval during tab open animation of about:newtab (preview=on), when other tabs are unaffected"
-  },
-  "FX_TAB_ANIM_OPEN_FRAME_INTERVAL_MS": {
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "low": 7,
-    "high": 500,
-    "n_buckets": 50,
-    "description": "Average frame interval during tab open animation of about:newtab (preview=off), when other tabs are unaffected"
-  },
-  "FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS": {
-    "expires_in_version": "never",
-    "kind": "exponential",
-    "low": 7,
-    "high": 500,
-    "n_buckets": 50,
-    "description": "Average frame interval during any tab open/close animation (excluding tabstrip scroll)"
-  },
   "FX_REFRESH_DRIVER_CHROME_FRAME_DELAY_MS": {
     "alert_emails": ["perf-telemetry-alerts@mozilla.com"],
     "expires_in_version": "never",
     "kind": "exponential",
     "high": 10000,
     "n_buckets": 50,
     "bug_numbers": [1220699],
     "description": "Delay in ms between the target and the actual handling time of the frame at refresh driver in the chrome process."
--- a/toolkit/components/telemetry/histogram-whitelists.json
+++ b/toolkit/components/telemetry/histogram-whitelists.json
@@ -257,19 +257,16 @@
     "FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE",
     "FX_NEW_WINDOW_MS",
     "FX_PAGE_LOAD_MS",
     "FX_SESSION_RESTORE_DOM_STORAGE_SIZE_ESTIMATE_CHARS",
     "FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED",
     "FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED",
     "FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED",
     "FX_TABLETMODE_PAGE_LOAD",
-    "FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS",
-    "FX_TAB_ANIM_OPEN_FRAME_INTERVAL_MS",
-    "FX_TAB_ANIM_OPEN_PREVIEW_FRAME_INTERVAL_MS",
     "FX_TAB_CLICK_MS",
     "FX_TAB_SWITCH_SPINNER_VISIBLE_MS",
     "FX_TAB_SWITCH_TOTAL_E10S_MS",
     "FX_TAB_SWITCH_TOTAL_MS",
     "FX_THUMBNAILS_BG_CAPTURE_CANVAS_DRAW_TIME_MS",
     "FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2",
     "FX_THUMBNAILS_BG_CAPTURE_PAGE_LOAD_TIME_MS",
     "FX_THUMBNAILS_BG_CAPTURE_QUEUE_TIME_MS",
@@ -963,19 +960,16 @@
     "FX_SESSION_RESTORE_READ_FILE_MS",
     "FX_SESSION_RESTORE_RESTORE_WINDOW_MS",
     "FX_SESSION_RESTORE_SEND_UPDATE_CAUSED_OOM",
     "FX_SESSION_RESTORE_SERIALIZE_DATA_MS",
     "FX_SESSION_RESTORE_STARTUP_INIT_SESSION_MS",
     "FX_SESSION_RESTORE_STARTUP_ONLOAD_INITIAL_WINDOW_MS",
     "FX_SESSION_RESTORE_WRITE_FILE_MS",
     "FX_TABLETMODE_PAGE_LOAD",
-    "FX_TAB_ANIM_ANY_FRAME_INTERVAL_MS",
-    "FX_TAB_ANIM_OPEN_FRAME_INTERVAL_MS",
-    "FX_TAB_ANIM_OPEN_PREVIEW_FRAME_INTERVAL_MS",
     "FX_TAB_CLICK_MS",
     "FX_TAB_SWITCH_SPINNER_VISIBLE_MS",
     "FX_TAB_SWITCH_TOTAL_E10S_MS",
     "FX_TAB_SWITCH_TOTAL_MS",
     "FX_TAB_SWITCH_UPDATE_MS",
     "FX_THUMBNAILS_BG_CAPTURE_CANVAS_DRAW_TIME_MS",
     "FX_THUMBNAILS_BG_CAPTURE_DONE_REASON_2",
     "FX_THUMBNAILS_BG_CAPTURE_PAGE_LOAD_TIME_MS",