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

Unified Diff: components/metrics/metrics_service.cc

Issue 2646163004: Add a feature to control if we drop records due to excess events. Enabled by default as this is cur… (Closed)
Patch Set: wording Created 3 years, 11 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 | « no previous file | tools/metrics/histograms/histograms.xml » ('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 7a9b04006710a8368f0d4bab125ec5dd3ad79ae4..c524b7b25b4f214e953f999aae652540852b40da 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -178,6 +178,11 @@ namespace {
const base::Feature kUploadSchedulerFeature{"UMAUploadScheduler",
base::FEATURE_DISABLED_BY_DEFAULT};
+// 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};
+
bool HasUploadScheduler() {
return base::FeatureList::IsEnabled(kUploadSchedulerFeature);
}
@@ -803,13 +808,14 @@ void MetricsService::CloseCurrentLog() {
if (!log_manager_.current_log())
return;
- // TODO(jar): Integrate bounds on log recording more consistently, so that we
- // can stop recording logs that are too big much sooner.
+ // 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());
- log_manager_.DiscardCurrentLog();
- OpenNewLog(); // Start trivial log to hold our histograms.
+ 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
« no previous file with comments | « no previous file | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698