Skip to content

Commit 0dfb26d

Browse files
author
Sean
committed
Bug 1908994 - Migrate NETWORK_CACHE_METADATA_* probes to Glean r=kershaw,acreskey,necko-reviewers
Differential Revision: https://phabricator.services.mozilla.com/D217177
1 parent 26159d2 commit 0dfb26d

File tree

3 files changed

+48
-18
lines changed

3 files changed

+48
-18
lines changed

netwerk/cache2/CacheFileMetadata.cpp

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
#include "mozilla/Telemetry.h"
1818
#include "mozilla/DebugOnly.h"
1919
#include "mozilla/IntegerPrintfMacros.h"
20+
#include "mozilla/glean/GleanMetrics.h"
2021
#include "prnetdb.h"
2122

2223
namespace mozilla::net {
@@ -635,13 +636,16 @@ nsresult CacheFileMetadata::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
635636
return NS_OK;
636637
}
637638

639+
#ifndef ANDROID
640+
mozilla::TimeStamp readEnd = mozilla::TimeStamp::Now();
638641
if (mFirstRead) {
639-
Telemetry::AccumulateTimeDelta(
640-
Telemetry::NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS, mReadStart);
642+
mozilla::glean::networking::cache_metadata_first_read_time
643+
.AccumulateRawDuration(readEnd - mReadStart);
641644
} else {
642-
Telemetry::AccumulateTimeDelta(
643-
Telemetry::NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS, mReadStart);
645+
mozilla::glean::networking::cache_metadata_second_read_time
646+
.AccumulateRawDuration(readEnd - mReadStart);
644647
}
648+
#endif
645649

646650
// check whether we have read all necessary data
647651
uint32_t realOffset =
@@ -726,8 +730,9 @@ nsresult CacheFileMetadata::OnDataRead(CacheFileHandle* aHandle, char* aBuf,
726730
return NS_OK;
727731
}
728732

729-
Telemetry::Accumulate(Telemetry::NETWORK_CACHE_METADATA_SIZE_2,
730-
size - realOffset);
733+
#ifndef ANDROID
734+
mozilla::glean::networking::cache_metadata_size.Accumulate(size - realOffset);
735+
#endif
731736

732737
// We have all data according to offset information at the end of the entry.
733738
// Try to parse it.

netwerk/metrics.yaml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -903,6 +903,43 @@ networking:
903903
expires: never
904904
telemetry_mirror: HTTP_UPLOAD_THROUGHPUT_MBPS_HTTP_3_100
905905

906+
cache_metadata_first_read_time: &cache_metadata_first_read_time
907+
type: timing_distribution
908+
time_unit: millisecond
909+
description: >
910+
Time spent to read the first part of the metadata from the cache entry file.
911+
bugs:
912+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908994
913+
data_reviews:
914+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908994
915+
notification_emails:
916+
917+
expires: never
918+
telemetry_mirror: NETWORK_CACHE_METADATA_FIRST_READ_TIME_MS
919+
920+
cache_metadata_second_read_time:
921+
<<: *cache_metadata_first_read_time
922+
description: >
923+
Time spent to read the missing part of the metadata from the cache entry file.
924+
telemetry_mirror: NETWORK_CACHE_METADATA_SECOND_READ_TIME_MS
925+
926+
cache_metadata_size:
927+
type: memory_distribution
928+
memory_unit: byte
929+
description:
930+
Size of the metadata in bytes parsed from the disk.
931+
bugs:
932+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1133739
933+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1495336
934+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908994
935+
data_reviews:
936+
- https://bugzilla.mozilla.org/show_bug.cgi?id=1908994
937+
data_sensitivity:
938+
- technical
939+
notification_emails:
940+
941+
expires: never
942+
906943
residual_cache_folder_count:
907944
type: counter
908945
description: >

toolkit/components/telemetry/Histograms.json

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12547,18 +12547,6 @@
1254712547
"n_buckets": 50,
1254812548
"description": "Time spent to read the missing part of the metadata from the cache entry file."
1254912549
},
12550-
"NETWORK_CACHE_METADATA_SIZE_2": {
12551-
"record_in_processes": ["main"],
12552-
"products": ["firefox", "fennec"],
12553-
"alert_emails": ["[email protected]", "[email protected]"],
12554-
"bug_numbers": [1133739, 1495336],
12555-
"expires_in_version": "never",
12556-
"kind": "linear",
12557-
"low": 1024,
12558-
"high": 66560,
12559-
"n_buckets": 66,
12560-
"description": "Size of the metadata in bytes parsed from the disk."
12561-
},
1256212550
"NETWORK_CACHE_SIZE": {
1256312551
"record_in_processes": ["main"],
1256412552
"products": ["firefox", "fennec"],

0 commit comments

Comments
 (0)