OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_ |
| 6 #define COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_ |
| 7 |
| 8 #include "base/time/time.h" |
| 9 #include "components/metrics/metrics_reporting_scheduler.h" |
| 10 |
| 11 namespace ukm { |
| 12 |
| 13 // Scheduler task to drive a MetricsService object's uploading. |
| 14 class MetricsReportingScheduler : public metrics::MetricsReportingScheduler { |
| 15 public: |
| 16 // Creates MetricsServiceScheduler object with the given |upload_callback| |
| 17 // callback to call when uploading should happen and |
| 18 // |upload_interval_callback| to determine the interval between uploads |
| 19 // in steady state. |
| 20 MetricsReportingScheduler( |
| 21 const base::Closure& upload_callback, |
| 22 const base::Callback<base::TimeDelta(void)>& upload_interval_callback); |
| 23 ~MetricsReportingScheduler() override; |
| 24 |
| 25 private: |
| 26 // Record the init sequence order histogram. |
| 27 void LogMetricsInitSequence(InitSequence sequence) override; |
| 28 |
| 29 // Record the upload interval time. |
| 30 void LogActualUploadInterval(base::TimeDelta interval) override; |
| 31 |
| 32 DISALLOW_COPY_AND_ASSIGN(MetricsReportingScheduler); |
| 33 }; |
| 34 |
| 35 } // namespace ukm |
| 36 |
| 37 #endif // COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_ |
OLD | NEW |