Chromium Code Reviews| Index: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc |
| diff --git a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc |
| index 5655e12c92fdd4fc8fe6f62922396b85505649df..6632f84f7749795db795372800db6362360aa238 100644 |
| --- a/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc |
| +++ b/components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc |
| @@ -704,6 +704,7 @@ void DataReductionProxyCompressionStats::RecordContentLengthPrefs( |
| // Here, we prefer collecting less data but the collected data is |
| // associated with an accurate date. |
| if (days_since_last_update == 1) { |
| + RecordUserVisibleDataSavings(); |
| // The previous day's data point is the second one from the tail. |
| // Therefore (kNumDaysInHistory - 2) below. |
| RecordDailyContentLengthHistograms( |
| @@ -721,4 +722,23 @@ void DataReductionProxyCompressionStats::RecordContentLengthPrefs( |
| } |
| } |
| +void DataReductionProxyCompressionStats::RecordUserVisibleDataSavings() { |
| + int64 original_content_length; |
| + int64 received_content_length; |
| + int64 last_update_internal; |
| + GetContentLengths(kNumDaysInHistorySummary, &original_content_length, |
| + &received_content_length, &last_update_internal); |
| + |
| + int64 user_visible_savings_bytes = |
| + original_content_length - received_content_length; |
| + float user_visible_savings_percent = |
|
Alexei Svitkine (slow)
2015/06/05 15:46:53
Nit: No need for float, since the histogram trunca
Not at Google. Contact bengr
2015/06/05 17:59:42
Done.
|
| + (float)user_visible_savings_bytes * 100 / original_content_length; |
|
Alexei Svitkine (slow)
2015/06/05 15:46:53
Is there any chance that original_content_length w
Not at Google. Contact bengr
2015/06/05 17:59:42
Good catch. Fixed.
|
| + UMA_HISTOGRAM_PERCENTAGE( |
| + "Net.DailyUserVisibleSavingsPercent_DataRedictionProxyEnabled", |
| + user_visible_savings_percent); |
| + UMA_HISTOGRAM_COUNTS( |
| + "Net.DailyUserVisibleSavingsBytes_DataRedictionProxyEnabled", |
| + user_visible_savings_bytes >> 10); |
| +} |
| + |
| } // namespace data_reduction_proxy |