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

Unified Diff: components/metrics/metrics_service.cc

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_log_unittest.cc ('k') | ios/chrome/today_extension/today_metrics_logger.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/metrics/metrics_service.cc
diff --git a/components/metrics/metrics_service.cc b/components/metrics/metrics_service.cc
index 529af17d829491521866ac870048baf24d07d1a7..f489d16019e897f326b09e2effe5c263ffd1a411 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -162,11 +162,6 @@ namespace metrics {
namespace {
-// This drops records if the number of events (user action and omnibox) exceeds
-// the kEventLimit.
-const base::Feature kUMAThrottleEvents{"UMAThrottleEvents",
- base::FEATURE_ENABLED_BY_DEFAULT};
-
// The delay, in seconds, after starting recording before doing expensive
// initialization work.
#if defined(OS_ANDROID) || defined(OS_IOS)
@@ -179,9 +174,6 @@ const int kInitializationDelaySeconds = 5;
const int kInitializationDelaySeconds = 30;
#endif
-// The maximum number of events in a log uploaded to the UMA server.
-const int kEventLimit = 2400;
-
#if defined(OS_ANDROID) || defined(OS_IOS)
void MarkAppCleanShutdownAndCommit(CleanExitBeacon* clean_exit_beacon,
PrefService* local_state) {
@@ -646,16 +638,6 @@ void MetricsService::CloseCurrentLog() {
if (!log_manager_.current_log())
return;
- // TODO(rkaplow): Evaluate if this is needed.
- if (log_manager_.current_log()->num_events() > kEventLimit) {
- UMA_HISTOGRAM_COUNTS("UMA.Discarded Log Events",
- log_manager_.current_log()->num_events());
- if (base::FeatureList::IsEnabled(kUMAThrottleEvents)) {
- log_manager_.DiscardCurrentLog();
- OpenNewLog(); // Start trivial log to hold our histograms.
- }
- }
-
// If a persistent allocator is in use, update its internal histograms (such
// as how much memory is being used) before reporting.
base::PersistentHistogramAllocator* allocator =
@@ -678,6 +660,7 @@ void MetricsService::CloseCurrentLog() {
current_log->RecordGeneralMetrics(metrics_providers_);
RecordCurrentHistograms();
+ current_log->TruncateEvents();
DVLOG(1) << "Generated an ongoing log.";
log_manager_.FinishCurrentLog(log_store());
}
« no previous file with comments | « components/metrics/metrics_log_unittest.cc ('k') | ios/chrome/today_extension/today_metrics_logger.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698