Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(70)

Side by Side Diff: components/metrics/single_value_counts_histogram.h

Issue 2687583002: Add support for single sample metrics. (Closed)
Patch Set: Redesign! Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2017 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
5 #ifndef COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_
6 #define COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_
7
8 #include "base/macros.h"
9 #include "base/metrics/histogram_base.h"
10 #include "components/metrics/public/interfaces/single_value_histograms.mojom.h"
11
12 namespace metrics {
13
14 class SingleValueCountsHistogram : public mojom::SingleValueCountsHistogram {
15 public:
16 SingleValueCountsHistogram(const std::string& name,
17 base::HistogramBase::Sample min,
18 base::HistogramBase::Sample max,
19 uint32_t bucket_count);
20 ~SingleValueCountsHistogram() override;
21
22 private:
23 // mojom::SingleValueCountsHistogram implementation.
24 void SetSample(base::HistogramBase::Sample sample) override;
25
26 base::HistogramBase* const histogram_;
27
28 // The last sample provided to SetSample(). We use -1 as a sentinel value to
29 // indicate no sample has been set.
30 base::HistogramBase::Sample sample_ = -1;
31
32 DISALLOW_COPY_AND_ASSIGN(SingleValueCountsHistogram);
33 };
34
35 } // namespace metrics
36
37 #endif // COMPONENTS_METRICS_SINGLE_VALUE_COUNTS_HISTOGRAM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698