Bug 1172689 - Add telemetry for application reputation remote lookup timeouts. r?francois
MozReview-Commit-ID: GrmNPGGcOE5
--- a/toolkit/components/downloads/ApplicationReputation.cpp
+++ b/toolkit/components/downloads/ApplicationReputation.cpp
@@ -1023,16 +1023,18 @@ PendingLookup::SendRemoteQueryInternal()
return NS_OK;
}
NS_IMETHODIMP
PendingLookup::Notify(nsITimer* aTimer)
{
LOG(("Remote lookup timed out [this = %p]", this));
MOZ_ASSERT(aTimer == mTimeoutTimer);
+ Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT,
+ true);
mChannel->Cancel(NS_ERROR_NET_TIMEOUT);
mTimeoutTimer->Cancel();
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
//// nsIStreamListener
static NS_METHOD
@@ -1067,16 +1069,19 @@ PendingLookup::OnStartRequest(nsIRequest
NS_IMETHODIMP
PendingLookup::OnStopRequest(nsIRequest *aRequest,
nsISupports *aContext,
nsresult aResult) {
NS_ENSURE_STATE(mCallback);
bool shouldBlock = false;
uint32_t verdict = nsIApplicationReputationService::VERDICT_SAFE;
+ Accumulate(mozilla::Telemetry::APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT,
+ false);
+
nsresult rv = OnStopRequestInternal(aRequest, aContext, aResult,
&shouldBlock, &verdict);
OnComplete(shouldBlock, rv, verdict);
return rv;
}
nsresult
PendingLookup::OnStopRequestInternal(nsIRequest *aRequest,
--- a/toolkit/components/telemetry/Histograms.json
+++ b/toolkit/components/telemetry/Histograms.json
@@ -83,16 +83,23 @@
"n_values": 8,
"description": "Application reputation remote response (0=SAFE, 1=DANGEROUS, 2=UNCOMMON, 3=POTENTIALLY_UNWANTED, 4=DANGEROUS_HOST)"
},
"APPLICATION_REPUTATION_COUNT": {
"expires_in_version": "never",
"kind": "boolean",
"description": "Application reputation query count (both local and remote)"
},
+ "APPLICATION_REPUTATION_REMOTE_LOOKUP_TIMEOUT": {
+ "alert_emails": ["gcp@mozilla.com", "francois@mozilla.com"],
+ "expires_in_version": "55",
+ "kind": "boolean",
+ "bug_numbers": [1172689],
+ "description": "Recorded when application reputation remote lookup is performed, `true` is recorded if the lookup times out."
+ },
"AUDIOSTREAM_FIRST_OPEN_MS": {
"expires_in_version": "50",
"kind": "exponential",
"high": 10000,
"n_buckets": 50,
"description": "The length of time (in milliseconds) for the first open of AudioStream."
},
"AUDIOSTREAM_LATER_OPEN_MS": {