Bug 1927093 - Migrate scalars to use Glean APIs for script.preloader.mainthread_recompile, r=chutten.

Depends on D228300

Differential Revision: https://phabricator.services.mozilla.com/D228301
This commit is contained in:
Florian Quèze 2024-11-14 23:15:29 +00:00
parent 2405bf989f
commit 945f258b32
2 changed files with 30 additions and 2 deletions

View File

@ -23,6 +23,7 @@
#include "mozilla/Services.h"
#include "mozilla/StaticPrefs_javascript.h"
#include "mozilla/TaskController.h"
#include "mozilla/glean/GleanMetrics.h"
#include "mozilla/Telemetry.h"
#include "mozilla/Try.h"
#include "mozilla/Unused.h"
@ -1001,8 +1002,7 @@ already_AddRefed<JS::Stencil> ScriptPreloader::WaitForCachedStencil(
LOG(Info, "Script is small enough to recompile on main thread\n");
script->mReadyToExecute = true;
Telemetry::ScalarAdd(
Telemetry::ScalarID::SCRIPT_PRELOADER_MAINTHREAD_RECOMPILE, 1);
glean::script_preloader::mainthread_recompile.Add(1);
} else {
LOG(Info, "Must wait for async script load: %s\n", script->mURL.get());
auto start = TimeStamp::Now();

View File

@ -254,3 +254,31 @@ slow_script_warning:
telemetry_mirror: Slow_script_warning_Shown_Content
no_lint:
- COMMON_PREFIX
script.preloader:
mainthread_recompile:
type: counter
description: >
How many times we ended up recompiling a script from the script
preloader on the main thread.
This metric was generated to correspond to the Legacy Telemetry
scalar script.preloader.mainthread_recompile.
bugs:
- https://bugzil.la/1364235
- https://bugzil.la/1590385
- https://bugzil.la/1623098
- https://bugzil.la/1649954
- https://bugzil.la/1689257
- https://bugzil.la/1754639
data_reviews:
- https://bugzil.la/1364235
- https://bugzil.la/1590385
- https://bugzil.la/1623098
- https://bugzil.la/1649954
- https://bugzil.la/1689257
- https://bugzil.la/1754639
notification_emails:
- dothayer@mozilla.com
- plawless@mozilla.com
expires: never
telemetry_mirror: SCRIPT_PRELOADER_MAINTHREAD_RECOMPILE