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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Tim D. Smith 2018-11-14 21:37:51 +00:00
parent 6b90fb923c
commit 2a938fec1b
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);
}
}
},

View File

@ -6171,11 +6171,24 @@
},
"FX_PAGE_LOAD_MS": {
"record_in_processes": ["main", "content"],
"expires_in_version": "default",
"expires_in_version": "65",
"kind": "exponential",
"high": 10000,
"n_buckets": 20,
"description": "Firefox: Time taken to load a page (ms). This includes all static contents, no dynamic content. Loading of about: pages is not counted."
"description": "Firefox: Time taken to load a page (ms). This includes all static contents, no dynamic content. Loading of about: pages is not counted.",
"bug_numbers": [790213, 1504247],
"alert_emails": ["tdsmith@mozilla.com"]
},
"FX_PAGE_LOAD_MS_2": {
"record_in_processes": ["main", "content"],
"expires_in_version": "never",
"kind": "linear",
"high": 10000,
"n_buckets": 200,
"description": "Firefox: Time taken to load a page (ms). This includes all static contents, no dynamic content. Loading of about: pages is not counted.",
"bug_numbers": [1504247],
"alert_emails": ["tdsmith@mozilla.com", "perfteam@mozilla.com", "product-metrics-telemetry-alerts@mozilla.com"],
"releaseChannelCollection": "opt-out"
},
"FX_SCHEDULE_PRESSURE_IDLE_SAMPLE_MS": {
"record_in_processes": ["main"],

View File

@ -170,7 +170,6 @@
"FX_BROWSER_FULLSCREEN_USED",
"FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE",
"FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE",
"FX_PAGE_LOAD_MS",
"FX_SESSION_RESTORE_NUMBER_OF_EAGER_TABS_RESTORED",
"FX_SESSION_RESTORE_NUMBER_OF_TABS_RESTORED",
"FX_SESSION_RESTORE_NUMBER_OF_WINDOWS_RESTORED",
@ -670,7 +669,6 @@
"FX_BROWSER_FULLSCREEN_USED",
"FX_GESTURE_COMPRESS_SNAPSHOT_OF_PAGE",
"FX_GESTURE_INSTALL_SNAPSHOT_OF_PAGE",
"FX_PAGE_LOAD_MS",
"FX_SANITIZE_CACHE",
"FX_SANITIZE_COOKIES_2",
"FX_SANITIZE_DOWNLOADS",
@ -1307,7 +1305,8 @@
"GC_MINOR_REASON",
"GC_MINOR_REASON_LONG",
"SSL_CT_POLICY_COMPLIANT_CONNECTIONS_BY_CA",
"SSL_CT_POLICY_NON_COMPLIANT_CONNECTIONS_BY_CA"
"SSL_CT_POLICY_NON_COMPLIANT_CONNECTIONS_BY_CA",
"FX_PAGE_LOAD_MS_2"
],
"expiry_default": [
"IDLE_NOTIFY_IDLE_MS",
@ -1378,7 +1377,6 @@
"FX_SESSION_RESTORE_ALL_FILES_CORRUPT",
"SHOULD_AUTO_DETECT_LANGUAGE",
"A11Y_IATABLE_USAGE_FLAG",
"FX_PAGE_LOAD_MS",
"LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS",
"DENIED_TRANSLATION_OFFERS",
"XUL_CACHE_DISABLED",