bug 1472659 - add Telemetry::DNS_TRR_FIRST and Telemetry::DNS_TRR_DISABLED r=mcmanus
authorDaniel Stenberg <daniel@haxx.se>
Mon, 02 Jul 2018 13:50:21 +0200
changeset 480237 eba17f3d25efe4466f39d55271427126225f8db5
parent 480236 34fda494f1a8d91eb0b6a2ce5a9f139cf0de17be
child 480238 1dad493abb2dc49890a5d6a23340afa0719efd96
push id9719
push userffxbld-merge
push dateFri, 24 Aug 2018 17:49:46 +0000
treeherdermozilla-beta@719ec98fba77 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmcmanus
bugs1472659
milestone63.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
bug 1472659 - add Telemetry::DNS_TRR_FIRST and Telemetry::DNS_TRR_DISABLED r=mcmanus To help evaluate TRRfirst sucess/error rates. MozReview-Commit-ID: Ljrbed6UDG2
netwerk/dns/nsHostResolver.cpp
toolkit/components/telemetry/Histograms.json
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -296,16 +296,26 @@ nsHostRecord::ResolveComplete()
 
     if (mTRRUsed && mNativeUsed) {
         // both were used, accumulate comparative success
         AccumulateCategorical(mNativeSuccess && mTRRSuccess?
                               Telemetry::LABELS_DNS_TRR_COMPARE::BothWorked :
                               ((mNativeSuccess ? Telemetry::LABELS_DNS_TRR_COMPARE::NativeWorked :
                                 (mTRRSuccess ? Telemetry::LABELS_DNS_TRR_COMPARE::TRRWorked:
                                  Telemetry::LABELS_DNS_TRR_COMPARE::BothFailed))));
+    } else if (mResolverMode == MODE_TRRFIRST) {
+        if(flags & nsIDNSService::RESOLVE_DISABLE_TRR) {
+            // TRR is disabled on request, which is a next-level back-off method.
+            Telemetry::Accumulate(Telemetry::DNS_TRR_DISABLED, mNativeSuccess);
+        } else {
+            AccumulateCategorical(mTRRSuccess?
+                                  Telemetry::LABELS_DNS_TRR_FIRST::TRRWorked :
+                                  ((mNativeSuccess ? Telemetry::LABELS_DNS_TRR_FIRST::NativeFallback :
+                                    Telemetry::LABELS_DNS_TRR_FIRST::BothFailed)));
+        }
     }
 
     switch(mResolverMode) {
     case MODE_NATIVEONLY:
     case MODE_TRROFF:
         AccumulateCategorical(Telemetry::LABELS_DNS_LOOKUP_ALGORITHM::nativeOnly);
         break;
     case MODE_PARALLEL:
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3271,16 +3271,33 @@
     "record_in_processes": ["main"],
     "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
     "expires_in_version": "never",
     "kind": "categorical",
     "labels": ["BothWorked", "NativeWorked", "TRRWorked", "BothFailed"],
     "bug_numbers": [1460589],
     "description": "DNS: success distribution when both native and TRR were used"
   },
+  "DNS_TRR_FIRST": {
+    "record_in_processes": ["main"],
+    "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
+    "expires_in_version": "never",
+    "kind": "categorical",
+    "labels": ["TRRWorked", "NativeFallback", "BothFailed"],
+    "bug_numbers": [1472659],
+    "description": "TRR-first mode distribution. 0=Worked, 1=fell back to native, 2=both failed"
+  },
+  "DNS_TRR_DISABLED": {
+    "record_in_processes": ["main"],
+    "expires_in_version": "never",
+    "kind": "boolean",
+    "description": "Resolve success rate when in TRR-first and called TRR-disabled (fall-back mode)",
+    "bug_numbers": [1472659],
+    "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"]
+  },
   "DNS_TRR_BLACKLISTED": {
     "record_in_processes": ["main"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "DNS check for TRR was blocked by blacklist",
     "bug_numbers": [1434852],
     "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"]
   },