Commit aa0b30fe authored by gayane's avatar gayane Committed by Commit bot

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}
parent a5ca99bd
......@@ -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();
}
......
......@@ -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_;
......
......@@ -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>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment