Bug 977730 - Count total pages visited by all test users. r=bsmedberg.
authorAsaf Romano <aromano@mozilla.com>
Tue, 01 Apr 2014 11:27:03 +0300
changeset 176357 2ff1425ff217d22bc7ee8ae8865dd1acb57cdd6c
parent 176356 ba893b9fd2af599f8ac9a63e17d7960dddf1e4d4
child 176358 88cbe809319cc7dab53f5ea73a8b10db0a2b673c
push id6070
push useraromano@mozilla.com
push dateTue, 01 Apr 2014 08:27:29 +0000
treeherderfx-team@2ff1425ff217 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbsmedberg
bugs977730
milestone31.0a1
Bug 977730 - Count total pages visited by all test users. r=bsmedberg.
browser/base/content/browser.js
toolkit/components/telemetry/Histograms.json
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -3990,20 +3990,22 @@ var CombinedStopReload = {
   }
 };
 
 var TabsProgressListener = {
   onStateChange: function (aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
     // Collect telemetry data about tab load times.
     if (aWebProgress.isTopLevel) {
       if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
-        if (aStateFlags & Ci.nsIWebProgressListener.STATE_START)
+        if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
           TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
-        else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP)
+          Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
+        } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP) {
           TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
+        }
       } else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
                  aStatus == Cr.NS_BINDING_ABORTED) {
         TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);
       }
     }
 
     // Attach a listener to watch for "click" events bubbling up from error
     // pages and other similar pages (like about:newtab). This lets us fix bugs
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3250,16 +3250,21 @@
   "FX_PAGE_LOAD_MS": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": "10000",
     "n_buckets": 20,
     "extended_statistics_ok": true,
     "description": "Firefox: Time taken to load a page (ms)"
   },
+  "FX_TOTAL_TOP_VISITS": {
+    "expires_in_version": "never",
+    "kind": "boolean",
+    "description": "Count the number of times a new top page was starting to load"
+  },
   "FX_THUMBNAILS_CAPTURE_TIME_MS": {
     "expires_in_version": "never",
     "kind": "exponential",
     "high": "500",
     "n_buckets": 15,
     "extended_statistics_ok": true,
     "description": "THUMBNAILS: Time (ms) it takes to capture a thumbnail"
   },