Bug 1862939 - Part 2: Add LCP information to the Pageload Event. r=dpalmeiro

Differential Revision: https://phabricator.services.mozilla.com/D192695
This commit is contained in:
Bas Schouten 2023-11-06 20:32:44 +00:00
parent c5c5d07e9f
commit f84fd4c255
3 changed files with 17 additions and 0 deletions

View File

@ -2174,6 +2174,14 @@ void Document::AccumulatePageLoadTelemetry(
}
}
// Report the most up to date LCP time. For our histogram we actually report
// this on page unload.
if (TimeStamp lcpTime =
GetNavigationTiming()->GetLargestContentfulRenderTimeStamp()) {
aEventTelemetryDataOut.lcpTime = mozilla::Some(
static_cast<uint32_t>((lcpTime - navigationStart).ToMilliseconds()));
}
// DOM Content Loaded event
if (TimeStamp dclEventStart =
GetNavigationTiming()->GetDOMContentLoadedEventStartTimeStamp()) {

View File

@ -18,6 +18,7 @@ struct ParamTraits<mozilla::glean::perf::PageLoadExtra> {
static void Write(MessageWriter* aWriter, const paramType& aParam) {
WriteParam(aWriter, aParam.fcpTime);
WriteParam(aWriter, aParam.lcpTime);
WriteParam(aWriter, aParam.jsExecTime);
WriteParam(aWriter, aParam.loadTime);
WriteParam(aWriter, aParam.loadType);
@ -32,6 +33,7 @@ struct ParamTraits<mozilla::glean::perf::PageLoadExtra> {
static bool Read(MessageReader* aReader, paramType* aResult) {
return ReadParam(aReader, &aResult->fcpTime) &&
ReadParam(aReader, &aResult->lcpTime) &&
ReadParam(aReader, &aResult->jsExecTime) &&
ReadParam(aReader, &aResult->loadTime) &&
ReadParam(aReader, &aResult->loadType) &&

View File

@ -19,10 +19,12 @@ perf:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1759744
- https://bugzilla.mozilla.org/show_bug.cgi?id=1799727
- https://bugzilla.mozilla.org/show_bug.cgi?id=1834774
- https://bugzilla.mozilla.org/show_bug.cgi?id=1862939
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1759744#c5
- https://bugzilla.mozilla.org/show_bug.cgi?id=1799727#c4
- https://bugzilla.mozilla.org/show_bug.cgi?id=1834774#c3
- https://bugzilla.mozilla.org/show_bug.cgi?id=1862939#c5
notification_emails:
- perf-telemetry-alerts@mozilla.com
- dpalmeiro@mozilla.com
@ -48,6 +50,11 @@ perf:
"Time between firstContentfulPaint and navigationStart, in ms."
type: quantity
unit: ms
lcp_time:
description:
"Time between largestContentfulPaint and navigationStart, at the point of onLoad firing, in ms. This may differ from the final LCP value as reported through the LCP histogram."
type: quantity
unit: ms
js_exec_time:
description:
"Time spent executing JS during page load, in ms."