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

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: Addressed bengr comments 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..5007b2f57281ff1406035c14dfb96d8c6c4f40a8 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(
bengr 2014/09/02 05:11:38 Does this "Equals" do the right thing? E.g., what
megjablon 2014/09/02 21:00:16 Yes. This equals compares ignoring the differences
+ request.context()->proxy_service()->config())) {
+ RecordBypassedBytes(last_bypass_type_,
+ DataReductionProxyUsageStats::MANAGED_PROXY_CONFIG,
+ 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_->IsBypassedByDataReductionProxyLocalRules(
+ 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_PROXY_CONFIG:
+ UMA_HISTOGRAM_COUNTS(
+ "DataReductionProxy.BypassedBytes.ManagedProxyConfig",
+ 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