diff --git a/browser/components/newtab/AboutNewTabRedirector.sys.mjs b/browser/components/newtab/AboutNewTabRedirector.sys.mjs index 41915a1aa42b..4679beb4ffe5 100644 --- a/browser/components/newtab/AboutNewTabRedirector.sys.mjs +++ b/browser/components/newtab/AboutNewTabRedirector.sys.mjs @@ -295,12 +295,12 @@ export const AboutHomeStartupCacheChild = { let worker = this.getOrCreateWorker(); - TelemetryStopwatch.start("FX_ABOUTHOME_CACHE_CONSTRUCTION"); + let timerId = Glean.newtab.abouthomeCacheConstruction.start(); let { page, script } = await worker .post("construct", [state]) .finally(() => { - TelemetryStopwatch.finish("FX_ABOUTHOME_CACHE_CONSTRUCTION"); + Glean.newtab.abouthomeCacheConstruction.stopAndAccumulate(timerId); }); let pageInputStream = Cc[ diff --git a/browser/components/newtab/metrics.yaml b/browser/components/newtab/metrics.yaml index 5f479ae6451d..25e2823b0ba9 100644 --- a/browser/components/newtab/metrics.yaml +++ b/browser/components/newtab/metrics.yaml @@ -874,6 +874,38 @@ newtab: send_in_pings: - newtab + abouthome_cache_construction: + type: timing_distribution + description: > + The length of time (in milliseconds) that it takes for the cache worker to + generate the cache and return it to the main thread + + This metric was generated to correspond to the Legacy Telemetry + exponential histogram FX_ABOUTHOME_CACHE_CONSTRUCTION. + time_unit: millisecond + bugs: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1622263 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1683101 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1714258 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1730042 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1754641 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1781978 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1811151 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1841926 + data_reviews: + - https://bugzilla.mozilla.org/show_bug.cgi?id=1622263 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1683101 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1714258 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1730042 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1754641 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1781978 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1811151 + - https://bugzilla.mozilla.org/show_bug.cgi?id=1841926 + notification_emails: + - mconley@mozilla.com + expires: never + telemetry_mirror: FX_ABOUTHOME_CACHE_CONSTRUCTION + newtab.search: enabled: lifetime: application