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

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

Issue 510353004: Fixing DataReductionProxy.BypassedBytes.LocalBypassRules (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changing managed pac reporting Created 6 years, 4 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
Index: components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc
index b274e07cac4d8dc35e22fd53684c3edb0d8acd05..dcb72aef6c0f2a85651c818537edd1df0441c1be 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_usage_stats.cc
@@ -161,8 +161,18 @@ void DataReductionProxyUsageStats::SetBypassType(
void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
net::URLRequest& request,
- const BooleanPrefMember& data_reduction_proxy_enabled) {
+ const BooleanPrefMember& data_reduction_proxy_enabled,
+ const net::ProxyConfig& data_reduction_proxy_config) {
int64 content_length = request.received_response_content_length();
+
+ if (!data_reduction_proxy_config.Equals(
+ request.context()->proxy_service()->config())) {
bengr 2014/08/29 19:29:48 indent 4 more
megjablon 2014/08/29 20:26:32 Done.
+ RecordBypassedBytes(last_bypass_type_,
+ DataReductionProxyUsageStats::MANAGED_PAC,
+ content_length);
+ return;
+ }
+
if (data_reduction_proxy_params_->WasDataReductionProxyUsed(&request, NULL)) {
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::NOT_BYPASSED,
@@ -179,7 +189,8 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
}
if (data_reduction_proxy_enabled.GetValue() &&
- !data_reduction_proxy_params_->IsDataReductionProxyEligible(&request)) {
+ !data_reduction_proxy_params_->PassesDataReductionProxyLocalBypassRules(
+ request, data_reduction_proxy_config)) {
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::LOCAL_BYPASS_RULES,
content_length);
@@ -187,11 +198,6 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
}
if (triggering_request_) {
- RecordBypassedBytes(last_bypass_type_,
- DataReductionProxyUsageStats::TRIGGERING_REQUEST,
- content_length);
- triggering_request_ = false;
-
// We only record when audio or video triggers a bypass. We don't care
// about audio and video bypassed as collateral damage.
std::string mime_type;
@@ -203,7 +209,14 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::AUDIO_VIDEO,
content_length);
+ return;
}
+
+ RecordBypassedBytes(last_bypass_type_,
+ DataReductionProxyUsageStats::TRIGGERING_REQUEST,
+ content_length);
+ triggering_request_ = false;
+ return;
}
if (last_bypass_type_ != BYPASS_EVENT_TYPE_MAX) {
@@ -265,6 +278,11 @@ void DataReductionProxyUsageStats::RecordBypassedBytes(
"DataReductionProxy.BypassedBytes.LocalBypassRules",
content_length);
break;
+ case DataReductionProxyUsageStats::MANAGED_PAC:
+ UMA_HISTOGRAM_COUNTS(
+ "DataReductionProxy.BypassedBytes.ManagedPAC",
+ content_length);
+ break;
case DataReductionProxyUsageStats::AUDIO_VIDEO:
if (last_bypass_type_ == BYPASS_EVENT_TYPE_SHORT) {
UMA_HISTOGRAM_COUNTS(

Powered by Google App Engine
This is Rietveld 408576698