Bug 1640867 - Add new HTTP_CHANNEL_ONSTART_SUCCESS_TRR probe r=dragana,tdsmith,necko-reviewers
☠☠ backed out by 367d792db84e ☠ ☠
authorValentin Gosu <valentin.gosu@gmail.com>
Fri, 29 May 2020 21:23:50 +0000
changeset 533070 75a1f56ff1ee5a201e0c58f54aca828e242f59c0
parent 533069 a4c770a70516d96b512f3c9a1f9ee929b32b2150
child 533071 01ad1cd51a9b22a291308a38e432466efc388491
push id37462
push usermalexandru@mozilla.com
push dateSat, 30 May 2020 09:46:43 +0000
treeherdermozilla-central@8aaca63ec5c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdragana, tdsmith, necko-reviewers
bugs1640867
milestone78.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 1640867 - Add new HTTP_CHANNEL_ONSTART_SUCCESS_TRR probe r=dragana,tdsmith,necko-reviewers Differential Revision: https://phabricator.services.mozilla.com/D77127
netwerk/dns/TRRService.h
netwerk/protocol/http/nsHttpChannel.cpp
toolkit/components/telemetry/Histograms.json
--- a/netwerk/dns/TRRService.h
+++ b/netwerk/dns/TRRService.h
@@ -30,17 +30,17 @@ class TRRService : public TRRServiceBase
  public:
   NS_DECL_THREADSAFE_ISUPPORTS
   NS_DECL_NSIOBSERVER
   NS_DECL_NSITIMERCALLBACK
 
   TRRService();
   nsresult Init();
   nsresult Start();
-  bool Enabled(nsIRequest::TRRMode aMode);
+  bool Enabled(nsIRequest::TRRMode aMode = nsIRequest::TRR_FIRST_MODE);
   bool IsConfirmed() { return mConfirmationState == CONFIRM_OK; }
 
   bool AllowRFC1918() { return mRfc1918; }
   bool UseGET() { return mUseGET; }
   bool EarlyAAAA() { return mEarlyAAAA; }
   bool CheckIPv6Connectivity() { return mCheckIPv6Connectivity; }
   bool WaitForAllResponses() { return mWaitForAllResponses; }
   bool DisableIPv6() { return mDisableIPv6; }
--- a/netwerk/protocol/http/nsHttpChannel.cpp
+++ b/netwerk/protocol/http/nsHttpChannel.cpp
@@ -124,16 +124,17 @@
 #include "mozilla/net/AsyncUrlChannelClassifier.h"
 #include "mozilla/net/CookieJarSettings.h"
 #include "mozilla/net/NeckoChannelParams.h"
 #include "mozilla/net/UrlClassifierFeatureFactory.h"
 #include "HttpTrafficAnalyzer.h"
 #include "mozilla/net/SocketProcessParent.h"
 #include "js/Conversions.h"
 #include "mozilla/dom/SecFetch.h"
+#include "mozilla/net/TRRService.h"
 
 #ifdef MOZ_TASK_TRACER
 #  include "GeckoTaskTracer.h"
 #endif
 
 #ifdef MOZ_GECKO_PROFILER
 #  include "ProfilerMarkerPayload.h"
 #endif
@@ -7460,16 +7461,21 @@ nsHttpChannel::OnStartRequest(nsIRequest
 
   LOG(("nsHttpChannel::OnStartRequest [this=%p request=%p status=%" PRIx32
        "]\n",
        this, request, static_cast<uint32_t>(static_cast<nsresult>(mStatus))));
 
   Telemetry::Accumulate(Telemetry::HTTP_CHANNEL_ONSTART_SUCCESS,
                         NS_SUCCEEDED(mStatus));
 
+  if (gTRRService && gTRRService->Enabled()) {
+    Telemetry::Accumulate(Telemetry::HTTP_CHANNEL_ONSTART_SUCCESS_TRR,
+                          TRRService::AutoDetectedKey(), NS_SUCCEEDED(mStatus));
+  }
+
   if (mRaceCacheWithNetwork) {
     LOG(
         ("  racingNetAndCache - mFirstResponseSource:%d fromCache:%d "
          "fromNet:%d\n",
          static_cast<int32_t>(mFirstResponseSource), request == mCachePump,
          request == mTransactionPump));
     if (mFirstResponseSource == RESPONSE_PENDING) {
       // When the cache wins mFirstResponseSource is set to
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -3117,16 +3117,27 @@
     "products": ["firefox", "fennec", "geckoview"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "Successfully started HTTP channels",
     "bug_numbers": [1473333,1587226],
     "releaseChannelCollection": "opt-out",
     "alert_emails": ["necko@mozilla.com", "ddamjanovic@mozilla.com"]
   },
+  "HTTP_CHANNEL_ONSTART_SUCCESS_TRR" : {
+    "record_in_processes": ["main"],
+    "products": ["firefox", "fennec", "geckoview"],
+    "expires_in_version": "never",
+    "kind": "boolean",
+    "keyed": true,
+    "description": "Successfully started HTTP channels when TRR is enabled; Keyed by TRR auto-detected",
+    "bug_numbers": [1640867],
+    "releaseChannelCollection": "opt-out",
+    "alert_emails": ["necko@mozilla.com", "vgosu@mozilla.com"]
+  },
   "HTTP_CONNECTION_ENTRY_CACHE_HIT_1" : {
     "record_in_processes": ["main", "content"],
     "products": ["firefox", "fennec", "geckoview"],
     "expires_in_version": "never",
     "kind": "boolean",
     "description": "Fraction of sockets that used a nsConnectionEntry with history - size 300."
   },
   "HTTP_CACHE_DISPOSITION_3": {