| 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 26bc2dbfa7af7da7fa2c32613b25dc7086e244f9..a46e1d2cf59ffef45c65497d88ed57be6e6cdde0 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
|
| @@ -823,20 +823,42 @@ void DataReductionProxyCompressionStats::RecordRequestSizePrefs(
|
| "Net.DailyContentLength_DataReductionProxyEnabled_Application");
|
|
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyOriginalContentLengthWithDataReductionProxyEnabledVideo,
|
| "Net.DailyOriginalContentLength_DataReductionProxyEnabled_Video");
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyContentLengthWithDataReductionProxyEnabledVideo,
|
| "Net.DailyContentLength_DataReductionProxyEnabled_Video");
|
| + int64_t original_length_with_data_reduction_enabled_video = GetInt64(
|
| + data_reduction_proxy::prefs::
|
| + kDailyOriginalContentLengthWithDataReductionProxyEnabledVideo);
|
| + int64_t received_length_with_data_reduction_enabled_video =
|
| + GetInt64(data_reduction_proxy::prefs::
|
| + kDailyContentLengthWithDataReductionProxyEnabledVideo);
|
| + int percent_data_reduction_proxy_enabled_video = 0;
|
| + // UMA percentage cannot be negative.
|
| + // The DataReductionProxy server will only serve optimized video content
|
| + // if the optimized content is smaller than the original content.
|
| + // TODO(ryansturm): Track daily data inflation percents here and
|
| + // elsewhere. http://crbug.com/595818
|
| + if (original_length_with_data_reduction_enabled_video >
|
| + received_length_with_data_reduction_enabled_video) {
|
| + percent_data_reduction_proxy_enabled_video =
|
| + 100 * (original_length_with_data_reduction_enabled_video -
|
| + received_length_with_data_reduction_enabled_video) /
|
| + original_length_with_data_reduction_enabled_video;
|
| + }
|
| + UMA_HISTOGRAM_PERCENTAGE(
|
| + "Net.DailyContentSavingPercent_DataReductionProxyEnabled_Video",
|
| + percent_data_reduction_proxy_enabled_video);
|
|
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyOriginalContentLengthWithDataReductionProxyEnabledUnknown,
|
| "Net.DailyOriginalContentLength_DataReductionProxyEnabled_"
|
| "UnknownMime");
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyContentLengthWithDataReductionProxyEnabledUnknown,
|
| "Net.DailyContentLength_DataReductionProxyEnabled_UnknownMime")
|
| @@ -851,20 +873,42 @@ void DataReductionProxyCompressionStats::RecordRequestSizePrefs(
|
| "Net.DailyContentLength_ViaDataReductionProxy_Application");
|
|
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyOriginalContentLengthViaDataReductionProxyVideo,
|
| "Net.DailyOriginalContentLength_ViaDataReductionProxy_Video");
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyContentLengthViaDataReductionProxyVideo,
|
| "Net.DailyContentLength_ViaDataReductionProxy_Video");
|
| + int64_t original_length_via_data_reduction_proxy_video =
|
| + GetInt64(data_reduction_proxy::prefs::
|
| + kDailyOriginalContentLengthViaDataReductionProxyVideo);
|
| + int64_t received_length_via_data_reduction_proxy_video =
|
| + GetInt64(data_reduction_proxy::prefs::
|
| + kDailyContentLengthViaDataReductionProxyVideo);
|
| + int percent_via_data_reduction_proxy_video = 0;
|
| + // UMA percentage cannot be negative.
|
| + // The DataReductionProxy server will only serve optimized video content
|
| + // if the optimized content is smaller than the original content.
|
| + // TODO(ryansturm): Track daily data inflation percents here and
|
| + // elsewhere. http://crbug.com/595818
|
| + if (original_length_via_data_reduction_proxy_video >
|
| + received_length_via_data_reduction_proxy_video) {
|
| + percent_via_data_reduction_proxy_video =
|
| + 100 * (original_length_via_data_reduction_proxy_video -
|
| + received_length_via_data_reduction_proxy_video) /
|
| + original_length_via_data_reduction_proxy_video;
|
| + }
|
| + UMA_HISTOGRAM_PERCENTAGE(
|
| + "Net.DailyContentSavingPercent_ViaDataReductionProxy_Video",
|
| + percent_via_data_reduction_proxy_video);
|
|
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyOriginalContentLengthViaDataReductionProxyUnknown,
|
| "Net.DailyOriginalContentLength_ViaDataReductionProxy_UnknownMime");
|
| RECORD_INT64PREF_TO_HISTOGRAM(
|
| data_reduction_proxy::prefs::
|
| kDailyContentLengthViaDataReductionProxyUnknown,
|
| "Net.DailyContentLength_ViaDataReductionProxy_UnknownMime");
|
| }
|
|
|