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

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

Issue 324503003: Report data reduction proxy related daily content lengths even if zero (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: addressed comments. Created 6 years, 6 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_metrics.cc
diff --git a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc
index 7ad2809b68667ff87d3ead1ac6c846fa4c1d7d13..edc48203e3befd514bbd36591508140c0c6e6c5d 100644
--- a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc
+++ b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc
@@ -112,53 +112,46 @@ void RecordDailyContentLengthHistograms(
"Net.DailyContentPercent_DataReductionProxyEnabled",
(100 * received_length_with_data_reduction_enabled) / received_length);
- if (https_length_with_data_reduction_enabled > 0) {
- UMA_HISTOGRAM_COUNTS(
- "Net.DailyContentLength_DataReductionProxyEnabled_Https",
- https_length_with_data_reduction_enabled >> 10);
- UMA_HISTOGRAM_PERCENTAGE(
- "Net.DailyContentPercent_DataReductionProxyEnabled_Https",
- (100 * https_length_with_data_reduction_enabled) / received_length);
- }
-
- if (short_bypass_length_with_data_reduction_enabled > 0) {
- UMA_HISTOGRAM_COUNTS(
- "Net.DailyContentLength_DataReductionProxyEnabled_ShortBypass",
- short_bypass_length_with_data_reduction_enabled >> 10);
- UMA_HISTOGRAM_PERCENTAGE(
- "Net.DailyContentPercent_DataReductionProxyEnabled_ShortBypass",
- ((100 * short_bypass_length_with_data_reduction_enabled) /
- received_length));
- }
+ DCHECK_GE(https_length_with_data_reduction_enabled, 0);
+ UMA_HISTOGRAM_COUNTS(
+ "Net.DailyContentLength_DataReductionProxyEnabled_Https",
+ https_length_with_data_reduction_enabled >> 10);
+ UMA_HISTOGRAM_PERCENTAGE(
+ "Net.DailyContentPercent_DataReductionProxyEnabled_Https",
+ (100 * https_length_with_data_reduction_enabled) / received_length);
- if (long_bypass_length_with_data_reduction_enabled > 0) {
- UMA_HISTOGRAM_COUNTS(
- "Net.DailyContentLength_DataReductionProxyEnabled_LongBypass",
- long_bypass_length_with_data_reduction_enabled >> 10);
- UMA_HISTOGRAM_PERCENTAGE(
- "Net.DailyContentPercent_DataReductionProxyEnabled_LongBypass",
- ((100 * long_bypass_length_with_data_reduction_enabled) /
- received_length));
- }
+ DCHECK_GE(short_bypass_length_with_data_reduction_enabled, 0);
+ UMA_HISTOGRAM_COUNTS(
+ "Net.DailyContentLength_DataReductionProxyEnabled_ShortBypass",
+ short_bypass_length_with_data_reduction_enabled >> 10);
+ UMA_HISTOGRAM_PERCENTAGE(
+ "Net.DailyContentPercent_DataReductionProxyEnabled_ShortBypass",
+ ((100 * short_bypass_length_with_data_reduction_enabled) /
+ received_length));
- if (unknown_length_with_data_reduction_enabled > 0) {
- UMA_HISTOGRAM_COUNTS(
- "Net.DailyContentLength_DataReductionProxyEnabled_Unknown",
- unknown_length_with_data_reduction_enabled >> 10);
- UMA_HISTOGRAM_PERCENTAGE(
- "Net.DailyContentPercent_DataReductionProxyEnabled_Unknown",
- ((100 * unknown_length_with_data_reduction_enabled) /
- received_length));
- }
+ DCHECK_GE(long_bypass_length_with_data_reduction_enabled, 0);
+ UMA_HISTOGRAM_COUNTS(
+ "Net.DailyContentLength_DataReductionProxyEnabled_LongBypass",
+ long_bypass_length_with_data_reduction_enabled >> 10);
+ UMA_HISTOGRAM_PERCENTAGE(
+ "Net.DailyContentPercent_DataReductionProxyEnabled_LongBypass",
+ ((100 * long_bypass_length_with_data_reduction_enabled) /
+ received_length));
- if (original_length_via_data_reduction_proxy <= 0 ||
- received_length_via_data_reduction_proxy <= 0) {
- return;
- }
+ DCHECK_GE(unknown_length_with_data_reduction_enabled, 0);
+ UMA_HISTOGRAM_COUNTS(
+ "Net.DailyContentLength_DataReductionProxyEnabled_Unknown",
+ unknown_length_with_data_reduction_enabled >> 10);
+ UMA_HISTOGRAM_PERCENTAGE(
+ "Net.DailyContentPercent_DataReductionProxyEnabled_Unknown",
+ ((100 * unknown_length_with_data_reduction_enabled) /
+ received_length));
+ DCHECK_GE(original_length_via_data_reduction_proxy, 0);
UMA_HISTOGRAM_COUNTS(
"Net.DailyOriginalContentLength_ViaDataReductionProxy",
original_length_via_data_reduction_proxy >> 10);
+ DCHECK_GE(received_length_via_data_reduction_proxy, 0);
UMA_HISTOGRAM_COUNTS(
"Net.DailyContentLength_ViaDataReductionProxy",
received_length_via_data_reduction_proxy >> 10);
« 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