bug 1470813 - Telemetry::DNS_TRR_RACE2 adds two new categories r?mcmanus
... compared to DNS_TRR_RACE, to also count when either of the resolves
were more than 100 milliseconds faster.
MozReview-Commit-ID: FNZa7ZVuJPv
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -276,25 +276,34 @@ nsHostRecord::ResolveComplete()
AccumulateCategorical(Telemetry::LABELS_DNS_LOOKUP_DISPOSITION::trrAAAAOK);
} else if (mTrrAAAAUsed == FAILED) {
AccumulateCategorical(Telemetry::LABELS_DNS_LOOKUP_DISPOSITION::trrAAAAFail);
}
}
if (mTRRUsed && mNativeUsed && mNativeSuccess && mTRRSuccess) { // race or shadow!
static const TimeDuration k50ms = TimeDuration::FromMilliseconds(50);
+ static const TimeDuration k100ms = TimeDuration::FromMilliseconds(100);
if (mTrrDuration <= mNativeDuration) {
- AccumulateCategorical(((mNativeDuration - mTrrDuration) > k50ms) ?
- Telemetry::LABELS_DNS_TRR_RACE::TRRFasterBy50 :
- Telemetry::LABELS_DNS_TRR_RACE::TRRFaster);
+ if ((mNativeDuration - mTrrDuration) > k100ms) {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::TRRFasterBy100);
+ } else if ((mNativeDuration - mTrrDuration) > k50ms) {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::TRRFasterBy50);
+ } else {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::TRRFaster);
+ }
LOG(("nsHostRecord::Complete %s Dns Race: TRR\n", host.get()));
} else {
- AccumulateCategorical(((mTrrDuration - mNativeDuration) > k50ms) ?
- Telemetry::LABELS_DNS_TRR_RACE::NativeFasterBy50 :
- Telemetry::LABELS_DNS_TRR_RACE::NativeFaster);
+ if ((mTrrDuration - mNativeDuration) > k100ms) {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::NativeFasterBy100);
+ } else if ((mTrrDuration - mNativeDuration) > k50ms) {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::NativeFasterBy50);
+ } else {
+ AccumulateCategorical(Telemetry::LABELS_DNS_TRR_RACE2::NativeFaster);
+ }
LOG(("nsHostRecord::Complete %s Dns Race: NATIVE\n", host.get()));
}
}
if (mTRRUsed && mNativeUsed) {
// both were used, accumulate comparative success
AccumulateCategorical(mNativeSuccess && mTRRSuccess?
Telemetry::LABELS_DNS_TRR_COMPARE::BothWorked :
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3242,22 +3242,23 @@
"kind": "exponential",
"high": 60000,
"releaseChannelCollection": "opt-out",
"alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
"bug_numbers": [1434852],
"n_buckets": 50,
"description": "Time for a completed native name resolution (msec)"
},
- "DNS_TRR_RACE": {
+ "DNS_TRR_RACE2": {
"record_in_processes": ["main"],
"alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
"expires_in_version": "never",
"kind": "categorical",
- "labels": ["TRRFasterBy50", "TRRFaster", "NativeFaster", "NativeFasterBy50"],
+ "labels": ["TRRFasterBy100", "TRRFasterBy50", "TRRFaster", "NativeFaster", "NativeFasterBy50",
+ "NativeFasterBy100"],
"bug_numbers": [1434852],
"description": "DNS: TRR parallel resolve racing results"
},
"DNS_TRR_COMPARE": {
"record_in_processes": ["main"],
"alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
"expires_in_version": "never",
"kind": "categorical",