sampling_metrics_provider.cc 852 B

123456789101112131415161718192021222324
  1. // Copyright 2016 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. #include "components/metrics/sampling_metrics_provider.h"
  5. #include "base/metrics/histogram_base.h"
  6. #include "base/metrics/sparse_histogram.h"
  7. #include "components/metrics/metrics_provider.h"
  8. namespace metrics {
  9. SamplingMetricsProvider::SamplingMetricsProvider(int sampling_rate_per_mille)
  10. : sampling_rate_per_mille_(sampling_rate_per_mille) {}
  11. void SamplingMetricsProvider::ProvideStabilityMetrics(
  12. SystemProfileProto* system_profile_proto) {
  13. base::HistogramBase* histogram = base::SparseHistogram::FactoryGet(
  14. "UMA.SamplingRatePerMille",
  15. base::HistogramBase::kUmaStabilityHistogramFlag);
  16. histogram->Add(sampling_rate_per_mille_);
  17. }
  18. } // namespace metrics