OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_METRICS_HISTOGRAM_FLATTENER_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_FLATTENER_H_ |
6 #define BASE_METRICS_HISTOGRAM_FLATTENER_H_ | 6 #define BASE_METRICS_HISTOGRAM_FLATTENER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/memory/scoped_ptr.h" | 12 #include "base/memory/scoped_ptr.h" |
13 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 | 16 |
17 // HistogramFlattener is an interface for the logistics of gathering up | 17 // HistogramFlattener is an interface for the logistics of gathering up |
18 // available histograms for recording. The implementors handle the exact lower | 18 // available histograms for recording. The implementors handle the exact lower |
19 // level recording mechanism, or error report mechanism. | 19 // level recording mechanism, or error report mechanism. |
20 class BASE_EXPORT HistogramFlattener { | 20 class BASE_EXPORT HistogramFlattener { |
21 public: | 21 public: |
22 virtual void RecordDelta(const base::Histogram& histogram, | 22 virtual void RecordDelta(const base::Histogram& histogram, |
23 const base::Histogram::SampleSet& snapshot) = 0; | 23 const base::Histogram::SampleSet& snapshot) = 0; |
24 | 24 |
25 // Record various errors found during attempts to record histograms. | 25 // Will be called each time when a type of Inconsistenies is seen on a |
jar (doing other things)
2012/08/20 02:41:49
nit: remove either "each time" or "when".
Clarify
| |
26 virtual void InconsistencyDetected(int problem) = 0; | 26 // histogram. |
27 virtual void UniqueInconsistencyDetected(int problem) = 0; | 27 virtual void InconsistencyDetected(Histogram::Inconsistencies problem) = 0; |
28 virtual void SnapshotProblemResolved(int amount) = 0; | 28 |
29 // Will be called when a type of Inconsistenies is seen for the first time | |
30 // on a histogram. | |
jar (doing other things)
2012/08/20 02:41:49
nit: clarify who/when this is called, such as was
| |
31 virtual void UniqueInconsistencyDetected( | |
32 Histogram::Inconsistencies problem) = 0; | |
33 | |
34 // Will be called when the logged samples count of a histogram has | |
35 // inconsistency. |amount| is the difference. | |
jar (doing other things)
2012/08/20 02:41:49
nit: Clarify this line, possibly by replacing the
| |
36 virtual void InconsistencyDetectedInLoggedCount(int amount) = 0; | |
29 | 37 |
30 protected: | 38 protected: |
31 HistogramFlattener() {} | 39 HistogramFlattener() {} |
32 virtual ~HistogramFlattener() {} | 40 virtual ~HistogramFlattener() {} |
33 | 41 |
34 private: | 42 private: |
35 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener); | 43 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener); |
36 }; | 44 }; |
37 | 45 |
38 } // namespace base | 46 } // namespace base |
39 | 47 |
40 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_ | 48 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_ |
OLD | NEW |