summaryrefslogtreecommitdiff
path: root/chromium/components/ukm/ukm_rotation_scheduler.h
blob: 5c835277ea8a550d1a6f490a43044b669c992fe5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Copyright 2017 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_
#define COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_

#include "base/time/time.h"
#include "components/metrics/metrics_rotation_scheduler.h"

namespace ukm {

// Scheduler to drive a UkmService object's log rotations.
class UkmRotationScheduler : public metrics::MetricsRotationScheduler {
 public:
  // Creates UkmRotationScheduler object with the given |rotation_callback|
  // callback to call when log rotation should happen and |interval_callback|
  // to determine the interval between rotations in steady state.
  UkmRotationScheduler(
      const base::Closure& rotation_callback,
      const base::Callback<base::TimeDelta(void)>& interval_callback);
  ~UkmRotationScheduler() override;

 private:
  // Record the init sequence order histogram.
  void LogMetricsInitSequence(InitSequence sequence) override;

  DISALLOW_COPY_AND_ASSIGN(UkmRotationScheduler);
};

}  // namespace ukm

#endif  // COMPONENTS_UKM_METRICS_REPORTING_SCHEDULER_H_