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

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

Issue 2407073002: Record scheme of the data reduction proxy server (Closed)
Patch Set: Add missing include Created 4 years, 2 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 | components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc » ('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_bypass_stats.cc
diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
index d9607104d519e3951917ddb93d763b373fee2bda..31072e475d9ba4dbf534a98f51deed03ea80f8ef 100644
--- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
+++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats.cc
@@ -34,6 +34,31 @@ const int kMinFailedRequestsWhenUnavailable = 1;
const int kMaxSuccessfulRequestsWhenUnavailable = 0;
const int kMaxFailedRequestsBeforeReset = 3;
+// Scheme of the data reduction proxy used.
+enum ProxyScheme {
+ PROXY_SCHEME_UNKNOWN = 0,
+ PROXY_SCHEME_HTTP,
+ PROXY_SCHEME_HTTPS,
+ PROXY_SCHEME_QUIC,
+ PROXY_SCHEME_MAX
+};
+
+// Converts net::ProxyServer::Scheme to type ProxyScheme.
+ProxyScheme ConvertNetProxySchemeToProxyScheme(
+ net::ProxyServer::Scheme scheme) {
+ switch (scheme) {
+ case net::ProxyServer::SCHEME_HTTP:
+ return PROXY_SCHEME_HTTP;
+ case net::ProxyServer::SCHEME_HTTPS:
+ return PROXY_SCHEME_HTTPS;
+ case net::ProxyServer::SCHEME_QUIC:
+ return PROXY_SCHEME_QUIC;
+ default:
+ NOTREACHED() << scheme;
+ return PROXY_SCHEME_UNKNOWN;
+ }
+}
+
// Records a net error code that resulted in bypassing the data reduction
// proxy (|is_primary| is true) or the data reduction proxy fallback.
void RecordDataReductionProxyBypassOnNetworkError(
@@ -136,6 +161,11 @@ void DataReductionProxyBypassStats::OnUrlRequestCompleted(
UMA_HISTOGRAM_COUNTS_100(
"DataReductionProxy.SuccessfulRequestCompletionCounts",
proxy_info.proxy_index);
+ UMA_HISTOGRAM_ENUMERATION(
+ "DataReductionProxy.ProxySchemeUsed",
+ ConvertNetProxySchemeToProxyScheme(
+ proxy_info.proxy_servers.at(proxy_info.proxy_index).scheme()),
+ PROXY_SCHEME_MAX);
if (request->load_flags() & net::LOAD_MAIN_FRAME_DEPRECATED) {
UMA_HISTOGRAM_COUNTS_100(
"DataReductionProxy.SuccessfulRequestCompletionCounts.MainFrame",
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_bypass_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698