Chromium Code Reviews| 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..4360904870d452a3a9153e45675b34964bcd4ba9 100644 |
| --- a/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| +++ b/components/data_reduction_proxy/browser/data_reduction_proxy_metrics.cc |
| @@ -112,50 +112,43 @@ 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); |
| + DCHECK_GE(received_length_via_data_reduction_proxy, 0); |
|
bengr
2014/06/06 20:41:34
Move this down to just before the UMA that refers
bolian
2014/06/06 20:56:17
Done.
|
| UMA_HISTOGRAM_COUNTS( |
| "Net.DailyOriginalContentLength_ViaDataReductionProxy", |
| original_length_via_data_reduction_proxy >> 10); |