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

Unified Diff: ios/chrome/today_extension/today_metrics_logger.mm

Issue 2910023003: Change the logic for discarding all non-histogram logs because of actions/omnibox events to truncat… (Closed)
Patch Set: today extension Created 3 years, 7 months 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 | « components/metrics/metrics_service.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/today_extension/today_metrics_logger.mm
diff --git a/ios/chrome/today_extension/today_metrics_logger.mm b/ios/chrome/today_extension/today_metrics_logger.mm
index a248102b5d317a45290a61e3660c36182cf4aabe..cde4862519e0bdcab32f7e583e641fb78b26e6a9 100644
--- a/ios/chrome/today_extension/today_metrics_logger.mm
+++ b/ios/chrome/today_extension/today_metrics_logger.mm
@@ -46,9 +46,6 @@ NSString* const kTodayExtensionMetricsSessionID = @"MetricsSessionID";
// restart, this log can be written to disk for upload.
NSString* const kTodayExtensionMetricsCurrentLog = @"MetricsCurrentLog";
-// Maximum number of event in a log.
-const int kMaxEventsPerLog = 1000;
-
// Maximum age of a log.
const int kMaxLogLifeTimeInSeconds = 86400;
@@ -207,9 +204,9 @@ void TodayMetricsLogger::PersistLogs() {
[[NSUserDefaults standardUserDefaults]
setObject:ns_encoded_log
forKey:kTodayExtensionMetricsCurrentLog];
- if (log_->num_events() >= kMaxEventsPerLog ||
- (base::TimeTicks::Now() - log_->creation_time()).InSeconds() >=
- kMaxLogLifeTimeInSeconds) {
+ log_->TruncateEvents();
+ if ((base::TimeTicks::Now() - log_->creation_time()).InSeconds() >=
+ kMaxLogLifeTimeInSeconds) {
CreateNewLog();
}
}
« no previous file with comments | « components/metrics/metrics_service.cc ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698