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

Side by Side Diff: base/metrics/histogram_flattener.h

Issue 12207058: Connect SparseHistogram with the rest of stats system (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix and add tests Created 7 years, 10 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 | Annotate | Revision Log
OLDNEW
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/metrics/histogram.h" 12 #include "base/metrics/histogram.h"
13 13
14 namespace base { 14 namespace base {
15 15
16 class HistogramSamples; 16 class HistogramSamples;
17 17
18 // HistogramFlattener is an interface used by HistogramSnapshotManager, which 18 // HistogramFlattener is an interface used by HistogramSnapshotManager, which
19 // handles the logistics of gathering up available histograms for recording. 19 // handles the logistics of gathering up available histograms for recording.
20 // The implementors handle the exact lower level recording mechanism, or 20 // The implementors handle the exact lower level recording mechanism, or
21 // error report mechanism. 21 // error report mechanism.
22 class BASE_EXPORT HistogramFlattener { 22 class BASE_EXPORT HistogramFlattener {
23 public: 23 public:
24 virtual void RecordDelta(const HistogramBase& histogram, 24 virtual void RecordDelta(const HistogramBase& histogram,
25 const HistogramSamples& snapshot) = 0; 25 const HistogramSamples& snapshot) = 0;
26 26
27 // Will be called each time a type of Inconsistenies is seen on a histogram, 27 // Will be called each time a type of Inconsistenies is seen on a histogram,
Ilya Sherman 2013/02/21 05:36:06 nit: Please update the comment.
kaiwang 2013/02/27 04:39:42 Done.
28 // during inspections done internally in HistogramSnapshotManager class. 28 // during inspections done internally in HistogramSnapshotManager class.
29 virtual void InconsistencyDetected(Histogram::Inconsistencies problem) = 0; 29 virtual void InconsistencyDetected(HistogramInconsistency problem) = 0;
30 30
31 // Will be called when a type of Inconsistenies is seen for the first time 31 // Will be called when a type of Inconsistenies is seen for the first time
Ilya Sherman 2013/02/21 05:36:06 nit: Please update the comment.
kaiwang 2013/02/27 04:39:42 Done.
32 // on a histogram. 32 // on a histogram.
33 virtual void UniqueInconsistencyDetected( 33 virtual void UniqueInconsistencyDetected(HistogramInconsistency problem) = 0;
34 Histogram::Inconsistencies problem) = 0;
35 34
36 // Will be called when the total logged sample count of a histogram 35 // Will be called when the total logged sample count of a histogram
37 // differs from the sum of logged sample count in all the buckets. The 36 // differs from the sum of logged sample count in all the buckets. The
38 // argument |amount| is the non-zero discrepancy. 37 // argument |amount| is the non-zero discrepancy.
39 virtual void InconsistencyDetectedInLoggedCount(int amount) = 0; 38 virtual void InconsistencyDetectedInLoggedCount(int amount) = 0;
40 39
41 protected: 40 protected:
42 HistogramFlattener() {} 41 HistogramFlattener() {}
43 virtual ~HistogramFlattener() {} 42 virtual ~HistogramFlattener() {}
44 43
45 private: 44 private:
46 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener); 45 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener);
47 }; 46 };
48 47
49 } // namespace base 48 } // namespace base
50 49
51 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_ 50 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698