Bug 1877843 - Migrate javascript.pageload GVST metrics r=perry.mcmanis,denispal

Differential Revision: https://phabricator.services.mozilla.com/D200974
This commit is contained in:
Chris H-C 2024-02-09 21:11:06 +00:00
parent e1dedf867e
commit 1d5878c7f9
5 changed files with 142 additions and 133 deletions

View File

@ -1928,10 +1928,6 @@ void Document::LoadEventFired() {
}
}
static uint32_t ConvertToUnsignedFromDouble(double aNumber) {
return aNumber < 0 ? 0 : static_cast<uint32_t>(aNumber);
}
void Document::RecordPageLoadEventTelemetry(
glean::perf::PageLoadExtra& aEventTelemetryData) {
// If the page load time is empty, then the content wasn't something we want
@ -2244,41 +2240,34 @@ void Document::AccumulateJSTelemetry(
JS::JSTimers timers = JS::GetJSTimers(cx);
if (!timers.executionTime.IsZero()) {
Telemetry::Accumulate(
Telemetry::JS_PAGELOAD_EXECUTION_MS,
ConvertToUnsignedFromDouble(timers.executionTime.ToMilliseconds()));
glean::javascript_pageload::execution_time.AccumulateRawDuration(
timers.executionTime);
aEventTelemetryDataOut.jsExecTime = mozilla::Some(
static_cast<uint32_t>(timers.executionTime.ToMilliseconds()));
}
if (!timers.delazificationTime.IsZero()) {
Telemetry::Accumulate(Telemetry::JS_PAGELOAD_DELAZIFICATION_MS,
ConvertToUnsignedFromDouble(
timers.delazificationTime.ToMilliseconds()));
glean::javascript_pageload::delazification_time.AccumulateRawDuration(
timers.delazificationTime);
}
if (!timers.xdrEncodingTime.IsZero()) {
Telemetry::Accumulate(
Telemetry::JS_PAGELOAD_XDR_ENCODING_MS,
ConvertToUnsignedFromDouble(timers.xdrEncodingTime.ToMilliseconds()));
glean::javascript_pageload::xdr_encode_time.AccumulateRawDuration(
timers.xdrEncodingTime);
}
if (!timers.baselineCompileTime.IsZero()) {
Telemetry::Accumulate(Telemetry::JS_PAGELOAD_BASELINE_COMPILE_MS,
ConvertToUnsignedFromDouble(
timers.baselineCompileTime.ToMilliseconds()));
glean::javascript_pageload::baseline_compile_time.AccumulateRawDuration(
timers.baselineCompileTime);
}
if (!timers.gcTime.IsZero()) {
Telemetry::Accumulate(
Telemetry::JS_PAGELOAD_GC_MS,
ConvertToUnsignedFromDouble(timers.gcTime.ToMilliseconds()));
glean::javascript_pageload::gc_time.AccumulateRawDuration(timers.gcTime);
}
if (!timers.protectTime.IsZero()) {
Telemetry::Accumulate(
Telemetry::JS_PAGELOAD_PROTECT_MS,
ConvertToUnsignedFromDouble(timers.protectTime.ToMilliseconds()));
glean::javascript_pageload::protect_time.AccumulateRawDuration(
timers.protectTime);
}
}

View File

@ -357,3 +357,125 @@ performance.page:
- vchin@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
javascript.pageload:
execution_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_EXECUTION_MS
description: >
Time spent during page load executing Javascript in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
delazification_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_DELAZIFICATION_MS
description: >
Time spent during page load delazifying Javascript in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
xdr_encode_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_XDR_ENCODING_MS
description: >
Time spent during page load XDR encoding Javascript in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
baseline_compile_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_BASELINE_COMPILE_MS
description: >
Time spent during page load baseline compiling Javascript in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
gc_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_GC_MS
description: >
Time spent during page load in the GC in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
parse_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_PARSE_MS
description: >
Time spent during page load syntax parsing JS scripts on
the main thread in ms.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
protect_time:
type: timing_distribution
time_unit: millisecond
telemetry_mirror: JS_PAGELOAD_PROTECT_MS
description: >
Time spent during page load protecting JIT executable memory.
(Migrated from the geckoview metric of the same name.)
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
- https://bugzilla.mozilla.org/show_bug.cgi?id=1877843
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never

View File

@ -2856,9 +2856,8 @@ void ScriptLoader::LoadEventFired() {
MaybeTriggerBytecodeEncoding();
if (!mMainThreadParseTime.IsZero()) {
Telemetry::Accumulate(
Telemetry::JS_PAGELOAD_PARSE_MS,
static_cast<uint32_t>(mMainThreadParseTime.ToMilliseconds()));
glean::javascript_pageload::parse_time.AccumulateRawDuration(
mMainThreadParseTime);
}
}

View File

@ -15246,7 +15246,7 @@
},
"JS_PAGELOAD_EXECUTION_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15261,7 +15261,7 @@
},
"JS_PAGELOAD_DELAZIFICATION_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15276,7 +15276,7 @@
},
"JS_PAGELOAD_XDR_ENCODING_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15291,7 +15291,7 @@
},
"JS_PAGELOAD_BASELINE_COMPILE_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15306,7 +15306,7 @@
},
"JS_PAGELOAD_GC_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15321,7 +15321,7 @@
},
"JS_PAGELOAD_PROTECT_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"
@ -15336,7 +15336,7 @@
},
"JS_PAGELOAD_PARSE_MS": {
"record_in_processes": ["content"],
"products": ["firefox", "geckoview_streaming"],
"products": ["firefox"],
"alert_emails": [
"dpalmeiro@mozilla.com",
"perf-telemetry-alerts@mozilla.com"

View File

@ -12,107 +12,6 @@
---
$schema: moz://mozilla.org/schemas/glean/metrics/2-0-0
javascript.pageload:
execution_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_EXECUTION_MS
description: >
Time spent during page load executing Javascript in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
delazification_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_DELAZIFICATION_MS
description: >
Time spent during page load delazifying Javascript in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
xdr_encode_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_XDR_ENCODING_MS
description: >
Time spent during page load XDR encoding Javascript in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
baseline_compile_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_BASELINE_COMPILE_MS
description: >
Time spent during page load baseline compiling Javascript in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
gc_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_GC_MS
description: >
Time spent during page load in the GC in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
parse_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_PARSE_MS
description: >
Time spent during page load syntax parsing JS scripts on
the main thread in ms.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
protect_time:
type: timing_distribution
time_unit: millisecond
gecko_datapoint: JS_PAGELOAD_PROTECT_MS
description: >
Time spent during page load protecting JIT executable memory.
bugs:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139
data_reviews:
- https://bugzilla.mozilla.org/show_bug.cgi?id=1709139#c4
notification_emails:
- dpalmeiro@mozilla.com
- perf-telemetry-alerts@mozilla.com
expires: never
javascript.gc:
total_time:
type: timing_distribution