diff options
author | gayane <gayane@chromium.org> | 2014-10-16 09:35:34 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-10-16 16:35:46 +0000 |
commit | aa0b30fe93d8dbcf54cb693918c46f95f933d954 (patch) | |
tree | 466b2063fcbdee2c0a772153fa93351db73be89a | |
parent | a5ca99bd20d5c3709674a510cb53112b4b60399f (diff) | |
download | chromium_src-aa0b30fe93d8dbcf54cb693918c46f95f933d954.zip chromium_src-aa0b30fe93d8dbcf54cb693918c46f95f933d954.tar.gz chromium_src-aa0b30fe93d8dbcf54cb693918c46f95f933d954.tar.bz2 |
Histogram for recording actual log upload interval added.
Histogram is in minutes. In case logs are uploaded by multiple tasks the interval between those is not recorded.
BUG=421543
Review URL: https://codereview.chromium.org/633373011
Cr-Commit-Position: refs/heads/master@{#299902}
-rw-r--r-- | components/metrics/metrics_reporting_scheduler.cc | 15 | ||||
-rw-r--r-- | components/metrics/metrics_reporting_scheduler.h | 4 | ||||
-rw-r--r-- | tools/metrics/histograms/histograms.xml | 8 |
3 files changed, 27 insertions, 0 deletions
diff --git a/components/metrics/metrics_reporting_scheduler.cc b/components/metrics/metrics_reporting_scheduler.cc index faf5c62..53c0cc5 100644 --- a/components/metrics/metrics_reporting_scheduler.cc +++ b/components/metrics/metrics_reporting_scheduler.cc @@ -62,6 +62,14 @@ void LogMetricsInitSequence(InitSequence sequence) { INIT_SEQUENCE_ENUM_SIZE); } +void LogActualUploadInterval(TimeDelta interval) { + UMA_HISTOGRAM_CUSTOM_COUNTS("UMA.ActualLogUploadInterval", + interval.InMinutes(), + 1, + base::TimeDelta::FromHours(12).InMinutes(), + 50); +} + // Returns upload interval specified for the current experiment running. // TODO(gayane): Only for experimenting with upload interval for Android // (bug: 17391128). Should be removed once the experiments are done. @@ -126,6 +134,7 @@ void MetricsReportingScheduler::UploadFinished(bool server_is_healthy, upload_interval_ = TimeDelta::FromSeconds(kUnsentLogsIntervalSeconds); } else { upload_interval_ = GetStandardUploadInterval(); + last_upload_finish_time_ = base::TimeTicks::Now(); } if (running_) @@ -152,6 +161,12 @@ void MetricsReportingScheduler::TriggerUpload() { waiting_for_init_task_complete_ = true; return; } + + if (!last_upload_finish_time_.is_null()) { + LogActualUploadInterval(base::TimeTicks::Now() - last_upload_finish_time_); + last_upload_finish_time_ = base::TimeTicks(); + } + callback_pending_ = true; upload_callback_.Run(); } diff --git a/components/metrics/metrics_reporting_scheduler.h b/components/metrics/metrics_reporting_scheduler.h index 6aa1f39..19f0757 100644 --- a/components/metrics/metrics_reporting_scheduler.h +++ b/components/metrics/metrics_reporting_scheduler.h @@ -66,6 +66,10 @@ class MetricsReportingScheduler { // upload. base::TimeDelta upload_interval_; + // The tick count of the last time log upload has been finished and null if no + // upload has been done yet. + base::TimeTicks last_upload_finish_time_; + // Indicates that the scheduler is running (i.e., that Start has been called // more recently than Stop). bool running_; diff --git a/tools/metrics/histograms/histograms.xml b/tools/metrics/histograms/histograms.xml index e7fae3a..e788fa7 100644 --- a/tools/metrics/histograms/histograms.xml +++ b/tools/metrics/histograms/histograms.xml @@ -35798,6 +35798,14 @@ Therefore, the affected-histogram name has to have at least one dot in it. <summary>Whether the scroll is executed on main thread.</summary> </histogram> +<histogram name="UMA.ActualLogUploadInterval" units="minutes"> + <owner>asvitkine@chromium.org</owner> + <summary> + The actual interval between log upload start and previous log upload + finished within the same process. + </summary> +</histogram> + <histogram name="UMA.CleanExitBeaconConsistency" enum="UmaCleanExitConsistency"> <owner>erikwright@chromium.org</owner> <summary> |