summaryrefslogtreecommitdiff
path: root/chromium/components/metrics/sampling_metrics_provider.h
blob: 9c00e09e33ff748f8954e5140a6ba1918d0d1462 (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 2016 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_METRICS_SAMPLING_METRICS_PROVIDER_H_
#define COMPONENTS_METRICS_SAMPLING_METRICS_PROVIDER_H_

#include "components/metrics/metrics_provider.h"

namespace metrics {

// Provides metrics related to sampling of metrics reporting clients. In
// particular, the rate at which clients are sampled.
class SamplingMetricsProvider : public MetricsProvider {
 public:
  // |sampling_rate_per_mille| is the number of clients per 1000 that are in the
  // sample.
  explicit SamplingMetricsProvider(int sampling_rate_per_mille);
  ~SamplingMetricsProvider() override = default;
  SamplingMetricsProvider(const SamplingMetricsProvider&) = delete;
  SamplingMetricsProvider operator=(const SamplingMetricsProvider&) = delete;

 private:
  // MetricsProvider:
  void ProvideStabilityMetrics(
      SystemProfileProto* system_profile_proto) override;

  int sampling_rate_per_mille_;
};

}  // namespace metrics

#endif  // COMPONENTS_METRICS_SAMPLING_METRICS_PROVIDER_H_