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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc

Issue 1132413003: Add UMA to collect latency numbers for the Data Reduction Proxy secure proxy check. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: bengr CR comment Created 5 years, 7 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/core/browser/data_reduction_proxy_config.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
index 20154b7923b5a34f6df2f23adde6aaa825af9f3f..1c6e8eb903bd8ffc968fbc26a5c5554ca22521f0 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_config.cc
@@ -40,6 +40,10 @@ const char kUMAProxyProbeURL[] = "DataReductionProxy.ProbeURL";
// Key of the UMA DataReductionProxy.ProbeURLNetError histogram.
const char kUMAProxyProbeURLNetError[] = "DataReductionProxy.ProbeURLNetError";
+// Key of the UMA DataReductionProxy.SecureProxyCheck.Latency histogram.
+const char kUMAProxySecureProxyCheckLatency[] =
+ "DataReductionProxy.SecureProxyCheck.Latency";
+
// Record a network change event.
void RecordNetworkChangeEvent(DataReductionProxyNetworkChangeEvent event) {
UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.NetworkChangeEvents", event,
@@ -64,6 +68,13 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
std::string response;
source->GetResponseAsString(&response);
+ base::TimeDelta secure_proxy_check_latency =
+ base::Time::Now() - secure_proxy_check_start_time_;
+ if (secure_proxy_check_latency >= base::TimeDelta()) {
+ UMA_HISTOGRAM_MEDIUM_TIMES(kUMAProxySecureProxyCheckLatency,
+ secure_proxy_check_latency);
+ }
+
fetcher_callback_.Run(response, status, source->GetResponseCode());
}
@@ -85,6 +96,7 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
fetcher_callback_ = fetcher_callback;
+ secure_proxy_check_start_time_ = base::Time::Now();
fetcher_->Start();
}
@@ -97,6 +109,10 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
scoped_ptr<net::URLFetcher> fetcher_;
FetcherResponseCallback fetcher_callback_;
+ // Used to determine the latency in performing the Data Reduction Proxy secure
+ // proxy check.
+ base::Time secure_proxy_check_start_time_;
+
DISALLOW_COPY_AND_ASSIGN(SecureProxyChecker);
};
« 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