Bug 1280629 - Part 2: telemetry of e10 back pressure suspension rate r=dragana
authorJunior Hsu <juhsu@mozilla.com>
Wed, 15 Aug 2018 22:36:42 +0000
changeset 486767 ec225468adb7fe22aa21f94ffb6969254b471d23
parent 486766 45e540e5e0fc2bfca60fe015a546fdb6f2f01318
child 486768 279f7c58913c47635447b925be743a3b68366e41
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)
reviewersdragana
bugs1280629
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 1280629 - Part 2: telemetry of e10 back pressure suspension rate r=dragana Split this patch for data review Differential Revision: https://phabricator.services.mozilla.com/D2747
netwerk/protocol/http/HttpChannelParent.cpp
netwerk/protocol/http/HttpChannelParent.h
toolkit/components/telemetry/Histograms.json
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -68,16 +68,17 @@ HttpChannelParent::HttpChannelParent(con
   : mLoadContext(aLoadContext)
   , mNestedFrameId(0)
   , mIPCClosed(false)
   , mPBOverride(aOverrideStatus)
   , mStatus(NS_OK)
   , mIgnoreProgress(false)
   , mSentRedirect1BeginFailed(false)
   , mReceivedRedirect2Verify(false)
+  , mHasSuspendedByBackPressure(false)
   , mPendingDiversion(false)
   , mDivertingFromChild(false)
   , mDivertedOnStartRequest(false)
   , mSuspendedForDiversion(false)
   , mSuspendAfterSynthesizeResponse(false)
   , mWillSynthesizeResponse(false)
   , mCacheNeedFlowControlInitialized(false)
   , mNeedFlowControl(true)
@@ -1583,16 +1584,20 @@ HttpChannelParent::OnStopRequest(nsIRequ
 
   if (mIPCClosed ||
       !mBgParent ||
       !mBgParent->OnStopRequest(aStatusCode, timing,
                                 responseTrailer ? *responseTrailer : nsHttpHeaderArray())) {
     return NS_ERROR_UNEXPECTED;
   }
 
+  if (NeedFlowControl()) {
+    Telemetry::Accumulate(Telemetry::NETWORK_BACK_PRESSURE_SUSPENSION_RATE, mHasSuspendedByBackPressure);
+  }
+
   return NS_OK;
 }
 
 //-----------------------------------------------------------------------------
 // HttpChannelParent::nsIStreamListener
 //-----------------------------------------------------------------------------
 
 NS_IMETHODIMP
@@ -1651,16 +1656,17 @@ HttpChannelParent::OnDataAvailable(nsIRe
   }
 
   if (NeedFlowControl()) {
     // We're going to run out of sending window size
     if (mSendWindowSize > 0 && mSendWindowSize <= count) {
       MOZ_ASSERT(!mSuspendedForFlowControl);
       Unused << mChannel->Suspend();
       mSuspendedForFlowControl = true;
+      mHasSuspendedByBackPressure = true;
     }
     mSendWindowSize -= count;
   }
 
   return NS_OK;
 }
 
 bool
--- a/netwerk/protocol/http/HttpChannelParent.h
+++ b/netwerk/protocol/http/HttpChannelParent.h
@@ -311,16 +311,17 @@ private:
 
   // OnStatus is always called before OnProgress.
   // Set true in OnStatus if next OnProgress can be ignored
   // since the information can be recontructed from ODA.
   uint8_t mIgnoreProgress              : 1;
 
   uint8_t mSentRedirect1BeginFailed    : 1;
   uint8_t mReceivedRedirect2Verify     : 1;
+  uint8_t mHasSuspendedByBackPressure  : 1;
 
   // Indicates that diversion has been requested, but we could not start it
   // yet because the channel is still being opened with a synthesized response.
   uint8_t mPendingDiversion            : 1;
   // Once set, no OnStart/OnData/OnStop calls should be accepted; conversely, it
   // must be set when RecvDivertOnData/~DivertOnStop/~DivertComplete are
   // received from the child channel.
   uint8_t mDivertingFromChild          : 1;
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -1949,16 +1949,24 @@
     "record_in_processes": ["main"],
     "expires_in_version": "never",
     "alert_emails": ["necko@mozilla.com", "mnovotny@mozilla.com"],
     "bug_numbers": [1377223],
     "kind": "categorical",
     "labels": ["NotSent", "CachedContentUsed", "CachedContentNotUsed"],
     "description": "Stats for validation requests when cache won the race."
   },
+  "NETWORK_BACK_PRESSURE_SUSPENSION_RATE": {
+    "record_in_processes": ["main"],
+    "expires_in_version": "68",
+    "alert_emails": ["necko@mozilla.com", "junior@mozilla.com"],
+    "bug_numbers": [1280629],
+    "kind": "boolean",
+    "description": "Collect whether the flow control to enable e10s back pressure triggers the suspension (true) or not (false)"
+  },
   "NETWORK_HTTP_REDIRECT_TO_SCHEME" :{
     "record_in_processes": ["main"],
     "alert_emails": ["necko@mozilla.com", "seceng-telemetry@mozilla.com", "jkt@mozilla.com"],
     "bug_numbers": [1413512],
     "expires_in_version": "64",
     "kind": "categorical",
     "keyed": true,
     "description": "Count of the HTTP redirection that triggered by top-level document or by subresource, keyed by the URL scheme redirected to.",