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

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: Adding comment 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..e825ad5a9e10858b19c12734344746e498485724 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,21 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
return;
}
- if (triggering_request_) {
+ // We only record separate triggering request UMA for short, medium, and long
bengr 2014/09/19 17:23:33 Don't use "We" in comments. Change to: Triggering
megjablon 2014/09/19 17:58:02 Done.
+ // 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)) {
// We only record when audio or video triggers a bypass. We don't care
bengr 2014/09/19 17:23:33 Remove the "We"s in this comment too.
megjablon 2014/09/19 17:58:03 Done.
// about audio and video bypassed as collateral damage.
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.
bengr 2014/09/19 17:23:33 Add a comment that states that we only have a buck
megjablon 2014/09/19 17:58:02 Done.
- if (mime_type.compare(0, 6, "audio/") == 0 ||
- mime_type.compare(0, 6, "video/") == 0) {
+ 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_,
bengr 2014/09/19 17:23:33 This UMA is complicated enough that we should have
megjablon 2014/09/19 17:58:02 Done.
DataReductionProxyUsageStats::AUDIO_VIDEO,
content_length);
@@ -229,9 +235,9 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
if (data_reduction_proxy_params_->
AreDataReductionProxiesBypassed(request, NULL)) {
bengr 2014/09/19 17:23:33 Can the line break be before "request" instead of
megjablon 2014/09/19 17:58:03 Done.
- RecordBypassedBytes(last_bypass_type_,
- DataReductionProxyUsageStats::NETWORK_ERROR,
- content_length);
+ 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