bug 1470215 let Telemetry::DNS_NATIVE_QUEUING measure queue times r=mcmanus
authorDaniel Stenberg <daniel@haxx.se>
Mon, 25 Jun 2018 08:03:44 +0200
changeset 814160 2fafbc23c259ba61732ed064492271ec95248771
parent 814159 cc6ec2789c9d50a686f4df5a70bf0f1173d1d32e
child 814161 3928fa2e88ee1ed812cfe7a1f14d01e7e4b81201
push id115123
push userjdescottes@mozilla.com
push dateWed, 04 Jul 2018 17:42:29 +0000
reviewersmcmanus
bugs1470215
milestone63.0a1
bug 1470215 let Telemetry::DNS_NATIVE_QUEUING measure queue times r=mcmanus MozReview-Commit-ID: 77FE4SJOXMG
netwerk/dns/nsHostResolver.cpp
toolkit/components/telemetry/Histograms.json
--- a/netwerk/dns/nsHostResolver.cpp
+++ b/netwerk/dns/nsHostResolver.cpp
@@ -1813,16 +1813,19 @@ nsHostResolver::ThreadFunc()
             rec.swap(tmpRec);
         }
 
         LOG(("DNS lookup thread - Calling getaddrinfo for host [%s].\n",
              rec->host.get()));
 
         TimeStamp startTime = TimeStamp::Now();
         bool getTtl = rec->mGetTtl;
+        TimeDuration inQueue = startTime - rec->mNativeStart;
+        uint32_t ms = static_cast<uint32_t>(inQueue.ToMilliseconds());
+        Telemetry::Accumulate(Telemetry::DNS_NATIVE_QUEUING, ms);
         nsresult status = GetAddrInfo(rec->host, rec->af,
                                       rec->flags, &ai,
                                       getTtl);
 #if defined(RES_RETRY_ON_FAILURE)
         if (NS_FAILED(status) && rs.Reset()) {
             status = GetAddrInfo(rec->host, rec->af,
                                  rec->flags, &ai, getTtl);
         }
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3242,16 +3242,27 @@
     "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_NATIVE_QUEUING": {
+    "record_in_processes": ["main"],
+    "expires_in_version": "never",
+    "kind": "exponential",
+    "high": 60000,
+    "releaseChannelCollection": "opt-out",
+    "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
+    "bug_numbers": [1470215],
+    "n_buckets": 50,
+    "description": "Time in resolve queue waiting to getaddrinfo (msec)"
+  },
   "DNS_TRR_RACE": {
     "record_in_processes": ["main"],
     "alert_emails": ["necko@mozilla.com", "dstenberg@mozilla.com"],
     "expires_in_version": "never",
     "kind": "categorical",
     "labels": ["TRRFasterBy50", "TRRFaster", "NativeFaster", "NativeFasterBy50"],
     "bug_numbers": [1434852],
     "description": "DNS: TRR parallel resolve racing results"