• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2016 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #include "components/metrics/sampling_metrics_provider.h"
6 
7 #include "base/metrics/histogram_base.h"
8 #include "base/metrics/sparse_histogram.h"
9 #include "components/metrics/metrics_provider.h"
10 
11 namespace metrics {
12 
SamplingMetricsProvider(int sampling_rate_per_mille)13 SamplingMetricsProvider::SamplingMetricsProvider(int sampling_rate_per_mille)
14     : sampling_rate_per_mille_(sampling_rate_per_mille) {}
15 
ProvideStabilityMetrics(SystemProfileProto * system_profile_proto)16 void SamplingMetricsProvider::ProvideStabilityMetrics(
17     SystemProfileProto* system_profile_proto) {
18   base::HistogramBase* histogram = base::SparseHistogram::FactoryGet(
19       "UMA.SamplingRatePerMille",
20       base::HistogramBase::kUmaStabilityHistogramFlag);
21   histogram->Add(sampling_rate_per_mille_);
22 }
23 
24 }  // namespace metrics
25