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
3 // found in the LICENSE file.
5 #ifndef BASE_METRICS_HISTOGRAM_FLATTENER_H_
6 #define BASE_METRICS_HISTOGRAM_FLATTENER_H_
11 #include "base/basictypes.h"
12 #include "base/metrics/histogram.h"
16 class HistogramSamples
;
18 // HistogramFlattener is an interface used by HistogramSnapshotManager, which
19 // handles the logistics of gathering up available histograms for recording.
20 // The implementors handle the exact lower level recording mechanism, or
21 // error report mechanism.
22 class BASE_EXPORT HistogramFlattener
{
24 virtual void RecordDelta(const HistogramBase
& histogram
,
25 const HistogramSamples
& snapshot
) = 0;
27 // Will be called each time a type of Inconsistenies is seen on a histogram,
28 // during inspections done internally in HistogramSnapshotManager class.
29 virtual void InconsistencyDetected(Histogram::Inconsistencies problem
) = 0;
31 // Will be called when a type of Inconsistenies is seen for the first time
33 virtual void UniqueInconsistencyDetected(
34 Histogram::Inconsistencies problem
) = 0;
36 // 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
38 // argument |amount| is the non-zero discrepancy.
39 virtual void InconsistencyDetectedInLoggedCount(int amount
) = 0;
42 HistogramFlattener() {}
43 virtual ~HistogramFlattener() {}
46 DISALLOW_COPY_AND_ASSIGN(HistogramFlattener
);
51 #endif // BASE_METRICS_HISTOGRAM_FLATTENER_H_