Skip to content
This repository was archived by the owner on Jul 9, 2025. It is now read-only.

Commit eeee947

Browse files
committed
Bug 1944631 - Migrate histograms to use Glean APIs in netwerk/dns (excluding keyed boolean and categorical histograms that are not supported in Glean yet), r=chutten,necko-reviewers,valentin.
Differential Revision: https://phabricator.services.mozilla.com/D235632
1 parent 58a5bb3 commit eeee947

File tree

6 files changed

+586
-66
lines changed

6 files changed

+586
-66
lines changed

netwerk/dns/HostRecordQueue.cpp

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
55

66
#include "HostRecordQueue.h"
7-
#include "mozilla/Telemetry.h"
7+
#include "mozilla/glean/NetwerkDnsMetrics.h"
88
#include "nsQueryObject.h"
99

1010
namespace mozilla {
@@ -76,20 +76,16 @@ void HostRecordQueue::AddToEvictionQ(
7676
// record the age of the entry upon eviction.
7777
TimeDuration age = TimeStamp::NowLoRes() - head->mValidStart;
7878
if (aRec->IsAddrRecord()) {
79-
Telemetry::Accumulate(Telemetry::DNS_CLEANUP_AGE,
80-
static_cast<uint32_t>(age.ToSeconds() / 60));
79+
glean::dns::cleanup_age.AccumulateRawDuration(age);
8180
} else {
82-
Telemetry::Accumulate(Telemetry::DNS_BY_TYPE_CLEANUP_AGE,
83-
static_cast<uint32_t>(age.ToSeconds() / 60));
81+
glean::dns::by_type_cleanup_age.AccumulateRawDuration(age);
8482
}
8583
if (head->CheckExpiration(TimeStamp::Now()) !=
8684
nsHostRecord::EXP_EXPIRED) {
8785
if (aRec->IsAddrRecord()) {
88-
Telemetry::Accumulate(Telemetry::DNS_PREMATURE_EVICTION,
89-
static_cast<uint32_t>(age.ToSeconds() / 60));
86+
glean::dns::premature_eviction.AccumulateRawDuration(age);
9087
} else {
91-
Telemetry::Accumulate(Telemetry::DNS_BY_TYPE_PREMATURE_EVICTION,
92-
static_cast<uint32_t>(age.ToSeconds() / 60));
88+
glean::dns::by_type_premature_eviction.AccumulateRawDuration(age);
9389
}
9490
}
9591
}

netwerk/dns/TRR.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "mozilla/Maybe.h"
4040
#include "mozilla/Preferences.h"
4141
#include "mozilla/StaticPrefs_network.h"
42+
#include "mozilla/glean/NetwerkDnsMetrics.h"
4243
#include "mozilla/Telemetry.h"
4344
#include "mozilla/TimeStamp.h"
4445
#include "mozilla/Tokenizer.h"
@@ -993,7 +994,7 @@ void TRR::RecordProcessingTime(nsIChannel* aChannel) {
993994
return;
994995
}
995996

996-
Telemetry::AccumulateTimeDelta(Telemetry::DNS_TRR_PROCESSING_TIME, end);
997+
glean::dns::trr_processing_time.AccumulateRawDuration(TimeStamp::Now() - end);
997998

998999
LOG(("Processing DoH response took %f ms",
9991000
(TimeStamp::Now() - end).ToMilliseconds()));

0 commit comments

Comments
 (0)