diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 33c37b23f78..985d6fe20e7 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -3995,10 +3995,12 @@ var TabsProgressListener = { // 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); diff --git a/toolkit/components/telemetry/Histograms.json b/toolkit/components/telemetry/Histograms.json index a9a9d92ff06..3424f29c05c 100644 --- a/toolkit/components/telemetry/Histograms.json +++ b/toolkit/components/telemetry/Histograms.json @@ -3255,6 +3255,11 @@ "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",