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

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

Issue 566943004: DataReductionProxy.BypassedBytes.* counts all triggering request bytes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Sync and rebase Created 6 years, 3 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 b24094763c503b3a30ef59cf9ebad7ba84a9127a..6a35460833ea1746fe69116e333fe2d9776d0b96 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
@@ -198,15 +198,20 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
return;
}
- if (triggering_request_) {
- // We only record when audio or video triggers a bypass. We don't care
- // about audio and video bypassed as collateral damage.
+ // Only record separate triggering request UMA for short, medium, and long
+ // bypass events.
+ if (triggering_request_ &&
+ (last_bypass_type_ == BYPASS_EVENT_TYPE_SHORT ||
+ last_bypass_type_ == BYPASS_EVENT_TYPE_MEDIUM ||
+ last_bypass_type_ == BYPASS_EVENT_TYPE_LONG)) {
std::string mime_type;
request.GetMimeType(&mime_type);
- // MIME types are named by <media-type>/<subtype>. We check to see if the
- // media type is audio or video.
- if (mime_type.compare(0, 6, "audio/") == 0 ||
- mime_type.compare(0, 6, "video/") == 0) {
+ // MIME types are named by <media-type>/<subtype>. Check to see if the
+ // media type is audio or video. Only record when triggered by short bypass,
+ // there isn't an audio or video bucket for medium or long bypasses.
+ if (last_bypass_type_ == BYPASS_EVENT_TYPE_SHORT &&
+ (mime_type.compare(0, 6, "audio/") == 0 ||
+ mime_type.compare(0, 6, "video/") == 0)) {
RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::AUDIO_VIDEO,
content_length);
@@ -227,11 +232,11 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
return;
}
- if (data_reduction_proxy_params_->
- AreDataReductionProxiesBypassed(request, NULL)) {
- RecordBypassedBytes(last_bypass_type_,
- DataReductionProxyUsageStats::NETWORK_ERROR,
- content_length);
+ if (data_reduction_proxy_params_->AreDataReductionProxiesBypassed(request,
+ NULL)) {
+ RecordBypassedBytes(last_bypass_type_,
+ DataReductionProxyUsageStats::NETWORK_ERROR,
+ content_length);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698