Commit 4cafbe2f authored by bengr@chromium.org's avatar bengr@chromium.org

UMA for data reduction proxy probe net errors

Added UMA to report the type of net error that occurred
when the data reduction proxy probe failed due to a
network error. Note the probe can also fail due to
the response being modified, which this UMA does not
track.

BUG=397256

Review URL: https://codereview.chromium.org/417253002

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@285711 0039d316-1c4b-4281-b951-d872f2087c98
parent be81945e
......@@ -8,6 +8,7 @@
#include "base/command_line.h"
#include "base/metrics/field_trial.h"
#include "base/metrics/histogram.h"
#include "base/metrics/sparse_histogram.h"
#include "base/prefs/pref_member.h"
#include "base/prefs/pref_service.h"
#include "base/prefs/scoped_user_pref_update.h"
......@@ -53,6 +54,9 @@ const char kUMAProxyStartupStateHistogram[] =
// Key of the UMA DataReductionProxy.ProbeURL histogram.
const char kUMAProxyProbeURL[] = "DataReductionProxy.ProbeURL";
// Key of the UMA DataReductionProxy.ProbeURLNetError histogram.
const char kUMAProxyProbeURLNetError[] = "DataReductionProxy.ProbeURLNetError";
// Record a network change event.
void RecordNetworkChangeEvent(DataReductionProxyNetworkChangeEvent event) {
UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.NetworkChangeEvents",
......@@ -234,10 +238,16 @@ void DataReductionProxySettings::OnURLFetchComplete(
DCHECK(source == fetcher_.get());
net::URLRequestStatus status = source->GetStatus();
if (status.status() == net::URLRequestStatus::FAILED &&
status.error() == net::ERR_INTERNET_DISCONNECTED) {
RecordProbeURLFetchResult(INTERNET_DISCONNECTED);
return;
if (status.status() == net::URLRequestStatus::FAILED) {
if (status.error() == net::ERR_INTERNET_DISCONNECTED) {
RecordProbeURLFetchResult(INTERNET_DISCONNECTED);
return;
}
// TODO(bengr): Remove once we understand the reasons probes are failing.
// Probe errors are either due to fetcher-level errors or modified
// responses. This only tracks the former.
UMA_HISTOGRAM_SPARSE_SLOWLY(
kUMAProxyProbeURLNetError, std::abs(status.error()));
}
std::string response;
......
......@@ -3177,6 +3177,15 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary>
</histogram>
<histogram name="DataReductionProxy.ProbeURLNetError" enum="NetErrorCodes">
<owner>bengr@chromium.org</owner>
<owner>megjablon@chromium.org</owner>
<summary>
Reports the type of network error when the data reduction proxy probe fails
due to a network error.
</summary>
</histogram>
<histogram name="DataReductionProxy.PromoAction"
enum="DataReductionProxyPromoAction">
<owner>bengr@chromium.org</owner>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment