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..6db84f1034b6494e31a0f4c77dc9b2e9989d40f6 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,26 @@ 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); |
+ |
+ if (original_content_length == 0) |
+ return; |
+ |
+ int64 user_visible_savings_bytes = |
+ original_content_length - received_content_length; |
+ int user_visible_savings_percent = |
+ user_visible_savings_bytes * 100 / original_content_length; |
+ UMA_HISTOGRAM_PERCENTAGE( |
+ "Net.DailyUserVisibleSavingsPercent_DataRedictionProxyEnabled", |
+ user_visible_savings_percent); |
+ UMA_HISTOGRAM_COUNTS( |
+ "Net.DailyUserVisibleSavingsSize_DataRedictionProxyEnabled", |
+ user_visible_savings_bytes >> 10); |
bengr
2015/06/05 20:58:17
Why is this shifted 10?
Not at Google. Contact bengr
2015/06/05 21:00:32
To convert to KB.
bengr
2015/06/05 21:14:05
Ok. Dividing by 1024 is clearer imho.
Not at Google. Contact bengr
2015/06/05 21:19:42
Discussed in person. This file is using ">> 10" th
|
+} |
+ |
} // namespace data_reduction_proxy |