Skip to content

Commit

Permalink
UMA for data reduction proxy probe net errors
Browse files Browse the repository at this point in the history
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
  • Loading branch information
bengr@chromium.org committed Jul 25, 2014
1 parent be81945 commit 4cafbe2
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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;
Expand Down
9 changes: 9 additions & 0 deletions tools/metrics/histograms/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down

0 comments on commit 4cafbe2

Please sign in to comment.