summaryrefslogtreecommitdiffstats
path: root/components/metrics/metrics_provider.h
blob: 001e66a42c6330f55a673840983bf24570454c97 (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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
// Copyright 2014 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_METRICS_METRICS_PROVIDER_H_
#define COMPONENTS_METRICS_METRICS_PROVIDER_H_

#include "base/basictypes.h"

namespace metrics {

class ChromeUserMetricsExtension;
class SystemProfileProto;
class SystemProfileProto_Stability;

// MetricsProvider is an interface allowing different parts of the UMA protos to
// be filled out by different classes.
class MetricsProvider {
 public:
  MetricsProvider() {}
  virtual ~MetricsProvider() {}

  // Called when a new MetricsLog is created.
  virtual void OnDidCreateMetricsLog() {}

  // Called when metrics recording has been enabled.
  virtual void OnRecordingEnabled() {}

  // Called when metrics recording has been disabled.
  virtual void OnRecordingDisabled() {}

  // Provides additional metrics into the system profile.
  virtual void ProvideSystemProfileMetrics(
      SystemProfileProto* system_profile_proto) {}

  // Provides additional stability metrics. Stability metrics can be provided
  // directly into |stability_proto| fields or by logging stability histograms
  // via the UMA_STABILITY_HISTOGRAM_ENUMERATION() macro.
  virtual void ProvideStabilityMetrics(
      SystemProfileProto* system_profile_proto) {}

  // Provides general metrics that are neither system profile nor stability
  // metrics.
  virtual void ProvideGeneralMetrics(
      ChromeUserMetricsExtension* uma_proto) {}

 private:
  DISALLOW_COPY_AND_ASSIGN(MetricsProvider);
};

}  // namespace metrics

#endif  // COMPONENTS_METRICS_METRICS_PROVIDER_H_