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

Unified Diff: components/metrics/metrics_service.cc

Issue 612883003: Add a histogram to measure number of synthetic UMA trials. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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.h ('k') | 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 25240a2b95a66793627c2f3851e0fc5a5c2d3b17..35dd9276df925f139a878984b459b6aac95b1e20 100644
--- a/components/metrics/metrics_service.cc
+++ b/components/metrics/metrics_service.cc
@@ -766,10 +766,7 @@ void MetricsService::CloseCurrentLog() {
// MetricsLog class.
MetricsLog* current_log = log_manager_.current_log();
DCHECK(current_log);
- std::vector<variations::ActiveGroupId> synthetic_trials;
- GetCurrentSyntheticFieldTrials(&synthetic_trials);
- current_log->RecordEnvironment(
- metrics_providers_.get(), synthetic_trials, GetInstallDate());
+ RecordCurrentEnvironment(current_log);
base::TimeDelta incremental_uptime;
base::TimeDelta uptime;
GetUptimes(local_state_, &incremental_uptime, &uptime);
@@ -972,11 +969,7 @@ void MetricsService::PrepareInitialStabilityLog() {
void MetricsService::PrepareInitialMetricsLog() {
DCHECK(state_ == INIT_TASK_DONE || state_ == SENDING_INITIAL_STABILITY_LOG);
- std::vector<variations::ActiveGroupId> synthetic_trials;
- GetCurrentSyntheticFieldTrials(&synthetic_trials);
- initial_metrics_log_->RecordEnvironment(metrics_providers_.get(),
- synthetic_trials,
- GetInstallDate());
+ RecordCurrentEnvironment(initial_metrics_log_.get());
base::TimeDelta incremental_uptime;
base::TimeDelta uptime;
GetUptimes(local_state_, &incremental_uptime, &uptime);
@@ -1177,6 +1170,15 @@ scoped_ptr<MetricsLog> MetricsService::CreateLog(MetricsLog::LogType log_type) {
local_state_));
}
+void MetricsService::RecordCurrentEnvironment(MetricsLog* log) {
+ std::vector<variations::ActiveGroupId> synthetic_trials;
+ GetCurrentSyntheticFieldTrials(&synthetic_trials);
+ log->RecordEnvironment(metrics_providers_.get(), synthetic_trials,
+ GetInstallDate());
+ UMA_HISTOGRAM_COUNTS_100("UMA.SyntheticTrials.Count",
+ synthetic_trials.size());
+}
+
void MetricsService::RecordCurrentHistograms() {
DCHECK(log_manager_.current_log());
histogram_snapshot_manager_.PrepareDeltas(
« no previous file with comments | « components/metrics/metrics_service.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698