Commit 3d6e847d authored by megjablon's avatar megjablon Committed by Commit bot

DataReductionProxy.BypassedBytes.* counts all triggering request bytes

All DataReductionProxy.BypassedBytes.* UMA that don't have an explicit triggering
request UMA need to count the triggering request bytes.

BUG=413771

Review URL: https://codereview.chromium.org/566943004

Cr-Commit-Position: refs/heads/master@{#295848}
parent a5171187
...@@ -198,15 +198,20 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms( ...@@ -198,15 +198,20 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
return; return;
} }
if (triggering_request_) { // Only record separate triggering request UMA for short, medium, and long
// We only record when audio or video triggers a bypass. We don't care // bypass events.
// about audio and video bypassed as collateral damage. 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; std::string mime_type;
request.GetMimeType(&mime_type); request.GetMimeType(&mime_type);
// MIME types are named by <media-type>/<subtype>. We check to see if the // MIME types are named by <media-type>/<subtype>. Check to see if the
// media type is audio or video. // media type is audio or video. Only record when triggered by short bypass,
if (mime_type.compare(0, 6, "audio/") == 0 || // there isn't an audio or video bucket for medium or long bypasses.
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_, RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::AUDIO_VIDEO, DataReductionProxyUsageStats::AUDIO_VIDEO,
content_length); content_length);
...@@ -227,11 +232,11 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms( ...@@ -227,11 +232,11 @@ void DataReductionProxyUsageStats::RecordBypassedBytesHistograms(
return; return;
} }
if (data_reduction_proxy_params_-> if (data_reduction_proxy_params_->AreDataReductionProxiesBypassed(request,
AreDataReductionProxiesBypassed(request, NULL)) { NULL)) {
RecordBypassedBytes(last_bypass_type_, RecordBypassedBytes(last_bypass_type_,
DataReductionProxyUsageStats::NETWORK_ERROR, DataReductionProxyUsageStats::NETWORK_ERROR,
content_length); content_length);
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment