Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(153)

Unified Diff: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc

Issue 417253002: UMA for data reduction proxy probe net errors (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
index 7fc8138de326a4baa481d2642762af870fa2470a..70d182177fe6ad9e68980716e0547b161cb0fa74 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_settings.cc
@@ -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()));
mmenke 2014/07/25 18:27:00 UMA_HISTOGRAM_CUSTOM_ENUMERATION(kUMAProxyProbeURL
Alexei Svitkine (slow) 2014/07/25 18:28:21 No, sparse histogram is better in this case, as it
}
std::string response;
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698