OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_DELTA_SERIALIZATION_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ |
6 #define BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ | 6 #define BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 20 matching lines...) Expand all Loading... |
31 // will compute the deltas relative to this one. | 31 // will compute the deltas relative to this one. |
32 void PrepareAndSerializeDeltas(std::vector<std::string>* serialized_deltas); | 32 void PrepareAndSerializeDeltas(std::vector<std::string>* serialized_deltas); |
33 | 33 |
34 // Deserialize deltas and add samples to corresponding histograms, creating | 34 // Deserialize deltas and add samples to corresponding histograms, creating |
35 // them if necessary. Silently ignores errors in |serialized_deltas|. | 35 // them if necessary. Silently ignores errors in |serialized_deltas|. |
36 static void DeserializeAndAddSamples( | 36 static void DeserializeAndAddSamples( |
37 const std::vector<std::string>& serialized_deltas); | 37 const std::vector<std::string>& serialized_deltas); |
38 | 38 |
39 private: | 39 private: |
40 // HistogramFlattener implementation. | 40 // HistogramFlattener implementation. |
41 virtual void RecordDelta(const HistogramBase& histogram, | 41 void RecordDelta(const HistogramBase& histogram, |
42 const HistogramSamples& snapshot) OVERRIDE; | 42 const HistogramSamples& snapshot) override; |
43 virtual void InconsistencyDetected( | 43 virtual void InconsistencyDetected( |
44 HistogramBase::Inconsistency problem) OVERRIDE; | 44 HistogramBase::Inconsistency problem) override; |
45 virtual void UniqueInconsistencyDetected( | 45 void UniqueInconsistencyDetected( |
46 HistogramBase::Inconsistency problem) OVERRIDE; | 46 HistogramBase::Inconsistency problem) override; |
47 virtual void InconsistencyDetectedInLoggedCount(int amount) OVERRIDE; | 47 void InconsistencyDetectedInLoggedCount(int amount) override; |
48 | 48 |
49 // Calculates deltas in histogram counters. | 49 // Calculates deltas in histogram counters. |
50 HistogramSnapshotManager histogram_snapshot_manager_; | 50 HistogramSnapshotManager histogram_snapshot_manager_; |
51 | 51 |
52 // Output buffer for serialized deltas. | 52 // Output buffer for serialized deltas. |
53 std::vector<std::string>* serialized_deltas_; | 53 std::vector<std::string>* serialized_deltas_; |
54 | 54 |
55 // Histograms to count inconsistencies in snapshots. | 55 // Histograms to count inconsistencies in snapshots. |
56 HistogramBase* inconsistencies_histogram_; | 56 HistogramBase* inconsistencies_histogram_; |
57 HistogramBase* inconsistencies_unique_histogram_; | 57 HistogramBase* inconsistencies_unique_histogram_; |
58 HistogramBase* inconsistent_snapshot_histogram_; | 58 HistogramBase* inconsistent_snapshot_histogram_; |
59 | 59 |
60 DISALLOW_COPY_AND_ASSIGN(HistogramDeltaSerialization); | 60 DISALLOW_COPY_AND_ASSIGN(HistogramDeltaSerialization); |
61 }; | 61 }; |
62 | 62 |
63 } // namespace base | 63 } // namespace base |
64 | 64 |
65 #endif // BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ | 65 #endif // BASE_METRICS_HISTOGRAM_DELTA_SERIALIZATION_H_ |
OLD | NEW |