Bug 1487559 - add new telemetry probe for the mime type causing suspension for back pressure r=francois,valentin
Differential Revision:
https://phabricator.services.mozilla.com/D4729
--- a/netwerk/protocol/http/HttpChannelParent.cpp
+++ b/netwerk/protocol/http/HttpChannelParent.cpp
@@ -1640,26 +1640,34 @@ HttpChannelParent::OnStopRequest(nsIRequ
isLocal = isLocal || IsLoopBackAddress(&peerAddr);
if (!isLocal) {
if (!mHasSuspendedByBackPressure) {
AccumulateCategorical(Telemetry::LABELS_NETWORK_BACK_PRESSURE_SUSPENSION_RATE_V2::NotSuspended);
} else {
AccumulateCategorical(Telemetry::LABELS_NETWORK_BACK_PRESSURE_SUSPENSION_RATE_V2::Suspended);
+
+ // Only analyze non-local suspended cases, which we are interested in.
+ nsCOMPtr<nsILoadInfo> loadInfo;
+ if (NS_SUCCEEDED(mChannel->GetLoadInfo(getter_AddRefs(loadInfo)))) {
+ nsContentPolicyType type = loadInfo ?
+ loadInfo->InternalContentPolicyType() :
+ nsIContentPolicy::TYPE_OTHER;
+ Telemetry::Accumulate(Telemetry::NETWORK_BACK_PRESSURE_SUSPENSION_CP_TYPE, type);
+ }
}
} else {
if (!mHasSuspendedByBackPressure) {
AccumulateCategorical(Telemetry::LABELS_NETWORK_BACK_PRESSURE_SUSPENSION_RATE_V2::NotSuspendedLocal);
} else {
AccumulateCategorical(Telemetry::LABELS_NETWORK_BACK_PRESSURE_SUSPENSION_RATE_V2::SuspendedLocal);
}
}
}
-
return NS_OK;
}
//-----------------------------------------------------------------------------
// HttpChannelParent::nsIStreamListener
//-----------------------------------------------------------------------------
NS_IMETHODIMP
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -2002,16 +2002,25 @@
"record_in_processes": ["main"],
"expires_in_version": "68",
"alert_emails": ["necko@mozilla.com", "junior@mozilla.com"],
"bug_numbers": [1280629, 1494133],
"kind": "categorical",
"labels": ["Suspended", "NotSuspended", "SuspendedLocal", "NotSuspendedLocal"],
"description": "Collect whether the resource is suspended by back pressure. And split by local-ness."
},
+ "NETWORK_BACK_PRESSURE_SUSPENSION_CP_TYPE": {
+ "record_in_processes": ["main"],
+ "expires_in_version": "68",
+ "alert_emails": ["necko@mozilla.com", "junior@mozilla.com"],
+ "bug_numbers": [1487559],
+ "kind": "enumerated",
+ "n_values": 64,
+ "description": "Collect the content policy when the resource is non-local and suspended by back pressure (0-44 from nsContentPolicyType in nsIContentPolicy.idl)."
+ },
"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.",