| 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();
|
| }
|
| }
|
|
|