Bug 1338891 - Backout telemetry scroll tracking. r=smaug, a=jcristau
authorRyan Hunt <rhunt@eqrion.net>
Wed, 15 Feb 2017 18:56:23 -0500
changeset 378525 cd49d673aad3f925338ae31a0d8762edfbf8c0ff
parent 378524 77c5dd7e1f3a53ee46741522650871b5da6f602e
child 378526 9ec7bed2e1e00ea8de27f16642425719d74bf4bf
push id1419
push userjlund@mozilla.com
push dateMon, 10 Apr 2017 20:44:07 +0000
treeherdermozilla-release@5e6801b73ef6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug, jcristau
bugs1338891
milestone53.0a2
Bug 1338891 - Backout telemetry scroll tracking. r=smaug, a=jcristau
toolkit/components/telemetry/Histograms.json
toolkit/content/browser-content.js
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -10185,32 +10185,16 @@
   "SCROLL_INPUT_METHODS": {
     "alert_emails": ["botond@mozilla.com"],
     "bug_numbers": [1238137],
     "expires_in_version": "55",
     "kind": "enumerated",
     "n_values": 64,
     "description": "Count of scroll actions triggered by different input methods. See gfx/layers/apz/util/ScrollInputMethods.h for a list of possible values and their meanings."
   },
-  "TOTAL_SCROLL_Y": {
-    "alert_emails": ["hkirschner@mozilla.com"],
-    "bug_numbers": [1297867],
-    "expires_in_version": "58",
-    "kind": "count",
-    "description": "Count of the total number of CSS pixels scrolled up or down in the vertical axis of the root frame of all the pages visited in a subsession. This doesn't include any scrolling of nested scroll frames such as inputs, iframes, or scrollable divs."
-  },
-  "PAGE_MAX_SCROLL_Y": {
-    "alert_emails": ["hkirschner@mozilla.com"],
-    "bug_numbers": [1312881],
-    "expires_in_version": "58",
-    "kind": "exponential",
-    "high": 100000,
-    "n_buckets": 50,
-    "description": "Maximum distance in CSS pixels a user scrolls down the vertical axis of the root frame of a page. This doesn't include any scrolling of nested scroll frames such as inputs, iframes, or scrollable divs."
-  },
   "WEB_NOTIFICATION_CLICKED": {
     "releaseChannelCollection": "opt-out",
     "alert_emails": ["firefox-dev@mozilla.org"],
     "bug_numbers": [1225336],
     "expires_in_version": "55",
     "kind": "count",
     "description": "Count of times a web notification was clicked"
   },
--- a/toolkit/content/browser-content.js
+++ b/toolkit/content/browser-content.js
@@ -1756,84 +1756,16 @@ let DateTimePickerListener = {
       default:
         break;
     }
   },
 }
 
 DateTimePickerListener.init();
 
-/*
- * Telemetry probe to track the amount of scrolling a user does up and down the root frame
- * of a page, and also the maximum distance a user scrolls down the root frame of a page.
- * This doesn't include scrolling sub frames, but does include scrolling from JavaScript.
- * See bug 1312881 and bug 1297867 for more details.
- */
-let TelemetryScrollTracker = {
-  init() {
-    this._ignore = false;
-    this._prevScrollY = 0;
-    this._maxScrollY = 0;
-    this._amountHistogram = Services.telemetry.getHistogramById("TOTAL_SCROLL_Y");
-    this._maxHistogram = Services.telemetry.getHistogramById("PAGE_MAX_SCROLL_Y");
-
-    addEventListener("DOMWindowCreated", this, { passive: true });
-    addEventListener("pageshow", this, { passive: true });
-    addEventListener("scroll", this, { passive: true });
-    addEventListener("pagehide", this, { passive: true });
-  },
-
-  handleEvent(aEvent) {
-    if (aEvent.target !== content.document) {
-      return;
-    }
-
-    switch (aEvent.type) {
-      case "DOMWindowCreated": {
-        this._ignore = this.shouldIgnorePage();
-        this._prevScrollY = 0;
-        this._maxScrollY = 0;
-        break;
-      }
-      case "pageshow": {
-        this._ignore = this.shouldIgnorePage();
-        this._prevScrollY = content.scrollY;
-        this._maxScrollY = content.scrollY;
-        break;
-      }
-      case "scroll": {
-        if (this._ignore) {
-          return;
-        }
-
-        let amount = Math.abs(content.scrollY - this._prevScrollY);
-        this._amountHistogram.add(amount);
-        this._prevScrollY = content.scrollY;
-        this._maxScrollY = Math.max(content.scrollY, this._maxScrollY);
-        break;
-      }
-      case "pagehide": {
-        if (this._ignore) {
-          return;
-        }
-
-        this._maxHistogram.add(this._maxScrollY);
-        break;
-      }
-    }
-  },
-
-  shouldIgnorePage() {
-    return content.location == "" ||
-           content.location.protocol === "about:";
-  }
-};
-
-TelemetryScrollTracker.init();
-
 addEventListener("mozshowdropdown", event => {
   if (!event.isTrusted)
     return;
 
   if (!SelectContentHelper.open) {
     new SelectContentHelper(event.target, {isOpenedViaTouch: false}, this);
   }
 });