Bug 1504247 - Define a high-resolution page load time histogram r=dao,chutten

The FX_PAGE_LOAD_MS histogram, implemented in Bug 790213, measures the time it takes
Firefox to load a page's static content. Unfortunately, it uses only 20 buckets to cover
a 10,000ms range, so resolution is quite poor. The modal bucket is 860ms wide. There is
at least anecdotal evidence that increasing page load times by increments as small as 100 ms
can alter user behavior, so much better resolution is required to have confidence in changes
we expect to alter page load times. Also fixes Bug 1364957.

Differential Revision: https://phabricator.services.mozilla.com/D11198
This commit is contained in:
Tim D. Smith
2018-11-14 21:37:51 +00:00
parent 107b423e8a
commit f99e2603cd
3 changed files with 22 additions and 11 deletions

View File

@@ -5344,24 +5344,24 @@ var TabsProgressListener = {
onStateChange(aBrowser, aWebProgress, aRequest, aStateFlags, aStatus) {
// Collect telemetry data about tab load times.
if (aWebProgress.isTopLevel && (!aRequest.originalURI || aRequest.originalURI.spec.scheme != "about")) {
let stopwatchRunning = TelemetryStopwatch.running("FX_PAGE_LOAD_MS", aBrowser);
let stopwatchRunning = TelemetryStopwatch.running("FX_PAGE_LOAD_MS_2", aBrowser);
if (aStateFlags & Ci.nsIWebProgressListener.STATE_IS_WINDOW) {
if (aStateFlags & Ci.nsIWebProgressListener.STATE_START) {
if (stopwatchRunning) {
// Oops, we're seeing another start without having noticed the previous stop.
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS_2", aBrowser);
}
TelemetryStopwatch.start("FX_PAGE_LOAD_MS", aBrowser);
TelemetryStopwatch.start("FX_PAGE_LOAD_MS_2", aBrowser);
Services.telemetry.getHistogramById("FX_TOTAL_TOP_VISITS").add(true);
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
stopwatchRunning /* we won't see STATE_START events for pre-rendered tabs */) {
TelemetryStopwatch.finish("FX_PAGE_LOAD_MS", aBrowser);
TelemetryStopwatch.finish("FX_PAGE_LOAD_MS_2", aBrowser);
}
} else if (aStateFlags & Ci.nsIWebProgressListener.STATE_STOP &&
aStatus == Cr.NS_BINDING_ABORTED &&
stopwatchRunning /* we won't see STATE_START events for pre-rendered tabs */) {
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS", aBrowser);
TelemetryStopwatch.cancel("FX_PAGE_LOAD_MS_2", aBrowser);
}
}
},