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

Unified Diff: components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats.cc

Issue 2546273002: Record DRP histogram on how long back savings were cleared (Closed)
Patch Set: Rebased Created 4 years 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 | components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 40fbb7882ca0712e4eadf4f47640abc89fde054d..f3374d555916f0a9d32b6c3cee3efdf5262a1d25 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
@@ -201,6 +201,13 @@ void RecordDailyContentLengthHistograms(
percent_savings_via_data_reduction_proxy);
}
+void RecordSavingsClearedNegativeClockMetric(int days_since_last_update) {
+ // Data savings are cleared if the system clock moved back by more than
+ // one day.
+ UMA_HISTOGRAM_BOOLEAN("DataReductionProxy.SavingsCleared.NegativeSystemClock",
+ days_since_last_update < -1);
+}
+
} // namespace
class DataReductionProxyCompressionStats::DailyContentLengthUpdate {
@@ -923,6 +930,8 @@ void DataReductionProxyCompressionStats::RecordRequestSizePrefs(
"Net.DailyContentLength_ViaDataReductionProxy_UnknownMime");
}
+ RecordSavingsClearedNegativeClockMetric(days_since_last_update);
+
// The system may go backwards in time by up to a day for legitimate
// reasons, such as with changes to the time zone. In such cases, we
// keep adding to the current day which is why we check for
@@ -930,6 +939,11 @@ void DataReductionProxyCompressionStats::RecordRequestSizePrefs(
// Note: we accept the fact that some reported data is shifted to
// the adjacent day if users travel back and forth across time zones.
if (days_since_last_update && (days_since_last_update != -1)) {
+ if (days_since_last_update < -1) {
+ pref_service_->SetInt64(
+ prefs::kDataReductionProxySavingsClearedNegativeSystemClock,
+ now.ToInternalValue());
+ }
SetInt64(data_reduction_proxy::prefs::
kDailyHttpOriginalContentLengthApplication,
0);
« no previous file with comments | « no previous file | components/data_reduction_proxy/core/browser/data_reduction_proxy_compression_stats_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698