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

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

Issue 10857067: Add comments to HistogramFlatterner interface and rename a function (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 4 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
« no previous file with comments | « no previous file | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/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 used by HistogramSnapshotManager, which
18 // available histograms for recording. The implementors handle the exact lower 18 // handles the logistics of gathering up available histograms for recording.
19 // level recording mechanism, or error report mechanism. 19 // The implementors handle the exact lower level recording mechanism, or
20 // error report mechanism.
20 class BASE_EXPORT HistogramFlattener { 21 class BASE_EXPORT HistogramFlattener {
21 public: 22 public:
22 virtual void RecordDelta(const base::Histogram& histogram, 23 virtual void RecordDelta(const base::Histogram& histogram,
23 const base::Histogram::SampleSet& snapshot) = 0; 24 const base::Histogram::SampleSet& snapshot) = 0;
24 25
25 // Record various errors found during attempts to record histograms. 26 // Will be called each time a type of Inconsistenies is seen on a histogram,
26 virtual void InconsistencyDetected(int problem) = 0; 27 // during inspections done internally in HistogramSnapshotManager class.
27 virtual void UniqueInconsistencyDetected(int problem) = 0; 28 virtual void InconsistencyDetected(Histogram::Inconsistencies problem) = 0;
28 virtual void SnapshotProblemResolved(int amount) = 0; 29
30 // Will be called when a type of Inconsistenies is seen for the first time
31 // on a histogram.
32 virtual void UniqueInconsistencyDetected(
33 Histogram::Inconsistencies problem) = 0;
34
35 // Will be called when the total logged sample count of a histogram
36 // differs from the sum of logged sample count in all the buckets. The
37 // argument |amount| is the non-zero discrepancy.
38 virtual void InconsistencyDetectedInLoggedCount(int amount) = 0;
29 39
30 protected: 40 protected:
31 HistogramFlattener() {} 41 HistogramFlattener() {}
32 virtual ~HistogramFlattener() {} 42 virtual ~HistogramFlattener() {}
33 43
34 private: 44 private:
35 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener); 45 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener);
36 }; 46 };
37 47
38 } // namespace base 48 } // namespace base
39 49
40 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_ 50 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698