This repository was archived by the owner on Jul 9, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 5 files changed +58
-4
lines changed Expand file tree Collapse file tree 5 files changed +58
-4
lines changed Original file line number Diff line number Diff line change 15
15
#include " nsDOMString.h"
16
16
#include " nsXULAppAPI.h"
17
17
#include " mozilla/Unused.h"
18
+ #include " mozilla/glean/DomStorageMetrics.h"
18
19
#include " nsProxyRelease.h"
19
20
#include " nsThreadUtils.h"
20
21
@@ -237,8 +238,11 @@ void LocalStorageCache::WaitForPreload() {
237
238
// Telemetry of rates of pending preloads
238
239
if (!mPreloadTelemetryRecorded ) {
239
240
mPreloadTelemetryRecorded = true ;
240
- Telemetry::Accumulate (
241
- Telemetry::LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS, !loaded);
241
+ glean::localdomstorage::preload_pending_on_first_access
242
+ .EnumGet (static_cast <
243
+ glean::localdomstorage::PreloadPendingOnFirstAccessLabel>(
244
+ !loaded))
245
+ .Add ();
242
246
}
243
247
244
248
if (loaded) {
Original file line number Diff line number Diff line change 13
13
#include " nsTHashMap.h"
14
14
#include " nsHashKeys.h"
15
15
#include " mozilla/Monitor.h"
16
- #include " mozilla/Telemetry.h"
17
16
#include " mozilla/Atomics.h"
18
17
19
18
namespace mozilla ::dom {
Original file line number Diff line number Diff line change 24
24
#include " mozIStorageValueArray.h"
25
25
#include " mozIStorageFunction.h"
26
26
#include " mozilla/BasePrincipal.h"
27
+ #include " mozilla/glean/DomStorageMetrics.h"
27
28
#include " mozilla/ipc/BackgroundParent.h"
28
29
#include " nsIObserverService.h"
29
30
#include " nsThread.h"
@@ -248,7 +249,7 @@ nsresult StorageDBThread::Shutdown() {
248
249
return NS_ERROR_NOT_INITIALIZED;
249
250
}
250
251
251
- Telemetry::AutoTimer<Telemetry::LOCALDOMSTORAGE_SHUTDOWN_DATABASE_MS> timer ;
252
+ auto timer = glean::localdomstorage::shutdown_database. Measure () ;
252
253
253
254
{
254
255
MonitorAutoLock monitor (mThreadObserver ->GetMonitor ());
Original file line number Diff line number Diff line change
1
+ # This Source Code Form is subject to the terms of the Mozilla Public
2
+ # License, v. 2.0. If a copy of the MPL was not distributed with this
3
+ # file, You can obtain one at http://mozilla.org/MPL/2.0/.
4
+
5
+ # Adding a new metric? We have docs for that!
6
+ # https://firefox-source-docs.mozilla.org/toolkit/components/glean/user/new_definitions_file.html
7
+
8
+ ---
9
+ $schema : moz://mozilla.org/schemas/glean/metrics/2-0-0
10
+ $tags :
11
+ - ' Core :: Storage: localStorage & sessionStorage'
12
+
13
+ localdomstorage :
14
+ shutdown_database :
15
+ type : timing_distribution
16
+ description : >
17
+ Time to flush and close the localStorage database (ms)
18
+
19
+ This metric was generated to correspond to the Legacy Telemetry
20
+ exponential histogram LOCALDOMSTORAGE_SHUTDOWN_DATABASE_MS.
21
+ time_unit : millisecond
22
+ bugs :
23
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
24
+ data_reviews :
25
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
26
+ notification_emails :
27
+
28
+ expires : never
29
+ telemetry_mirror : LOCALDOMSTORAGE_SHUTDOWN_DATABASE_MS
30
+
31
+ preload_pending_on_first_access :
32
+ type : labeled_counter
33
+ description : >
34
+ True when we had to wait for a pending preload on first access to
35
+ localStorage data, false otherwise
36
+
37
+ This metric was generated to correspond to the Legacy Telemetry boolean
38
+ histogram LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS.
39
+ labels :
40
+ - " false"
41
+ - " true"
42
+ bugs :
43
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
44
+ data_reviews :
45
+ - https://bugzilla.mozilla.org/show_bug.cgi?id=1935420
46
+ notification_emails :
47
+
48
+ expires : never
49
+ telemetry_mirror : h#LOCALDOMSTORAGE_PRELOAD_PENDING_ON_FIRST_ACCESS
Original file line number Diff line number Diff line change 39
39
"dom/push/metrics.yaml" ,
40
40
"dom/quota/metrics.yaml" ,
41
41
"dom/security/metrics.yaml" ,
42
+ "dom/storage/metrics.yaml" ,
42
43
"dom/webauthn/metrics.yaml" ,
43
44
"gfx/metrics.yaml" ,
44
45
"image/decoders/metrics.yaml" ,
You can’t perform that action at this time.
0 commit comments