Commit e544d83b authored by jeremyim's avatar jeremyim Committed by Commit bot

Add UMA to collect latency numbers for the Data Reduction Proxy secure proxy check.

BUG=486897

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

Cr-Commit-Position: refs/heads/master@{#329906}
parent bdfedd5a
...@@ -40,6 +40,10 @@ const char kUMAProxyProbeURL[] = "DataReductionProxy.ProbeURL"; ...@@ -40,6 +40,10 @@ const char kUMAProxyProbeURL[] = "DataReductionProxy.ProbeURL";
// Key of the UMA DataReductionProxy.ProbeURLNetError histogram. // Key of the UMA DataReductionProxy.ProbeURLNetError histogram.
const char kUMAProxyProbeURLNetError[] = "DataReductionProxy.ProbeURLNetError"; const char kUMAProxyProbeURLNetError[] = "DataReductionProxy.ProbeURLNetError";
// Key of the UMA DataReductionProxy.SecureProxyCheck.Latency histogram.
const char kUMAProxySecureProxyCheckLatency[] =
"DataReductionProxy.SecureProxyCheck.Latency";
// Record a network change event. // Record a network change event.
void RecordNetworkChangeEvent(DataReductionProxyNetworkChangeEvent event) { void RecordNetworkChangeEvent(DataReductionProxyNetworkChangeEvent event) {
UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.NetworkChangeEvents", event, UMA_HISTOGRAM_ENUMERATION("DataReductionProxy.NetworkChangeEvents", event,
...@@ -64,6 +68,13 @@ class SecureProxyChecker : public net::URLFetcherDelegate { ...@@ -64,6 +68,13 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
std::string response; std::string response;
source->GetResponseAsString(&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()); fetcher_callback_.Run(response, status, source->GetResponseCode());
} }
...@@ -85,6 +96,7 @@ class SecureProxyChecker : public net::URLFetcherDelegate { ...@@ -85,6 +96,7 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
fetcher_callback_ = fetcher_callback; fetcher_callback_ = fetcher_callback;
secure_proxy_check_start_time_ = base::Time::Now();
fetcher_->Start(); fetcher_->Start();
} }
...@@ -97,6 +109,10 @@ class SecureProxyChecker : public net::URLFetcherDelegate { ...@@ -97,6 +109,10 @@ class SecureProxyChecker : public net::URLFetcherDelegate {
scoped_ptr<net::URLFetcher> fetcher_; scoped_ptr<net::URLFetcher> fetcher_;
FetcherResponseCallback fetcher_callback_; 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); DISALLOW_COPY_AND_ASSIGN(SecureProxyChecker);
}; };
......
...@@ -4484,6 +4484,16 @@ Therefore, the affected-histogram name has to have at least one dot in it. ...@@ -4484,6 +4484,16 @@ Therefore, the affected-histogram name has to have at least one dot in it.
</summary> </summary>
</histogram> </histogram>
<histogram name="DataReductionProxy.SecureProxyCheck.Latency"
units="milliseconds">
<owner>jeremyim@chromium.org</owner>
<owner>bengr@chromium.org</owner>
<summary>
Time from when the Data Reduction Proxy secure proxy check starts until it
completes.
</summary>
</histogram>
<histogram name="DataReductionProxy.SettingsConversion" <histogram name="DataReductionProxy.SettingsConversion"
enum="DataReductionProxySettingsConversion"> enum="DataReductionProxySettingsConversion">
<obsolete> <obsolete>
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