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_SNAPSHOT_MANAGER_H_ | 5 #ifndef BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ | 6 #define BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 30 matching lines...) Expand all Loading... |
41 // Snapshot this histogram, and record the delta. | 41 // Snapshot this histogram, and record the delta. |
42 void PrepareDelta(const HistogramBase& histogram); | 42 void PrepareDelta(const HistogramBase& histogram); |
43 | 43 |
44 // Try to detect and fix count inconsistency of logged samples. | 44 // Try to detect and fix count inconsistency of logged samples. |
45 void InspectLoggedSamplesInconsistency( | 45 void InspectLoggedSamplesInconsistency( |
46 const HistogramSamples& new_snapshot, | 46 const HistogramSamples& new_snapshot, |
47 HistogramSamples* logged_samples); | 47 HistogramSamples* logged_samples); |
48 | 48 |
49 // For histograms, track what we've already recorded (as a sample for | 49 // For histograms, track what we've already recorded (as a sample for |
50 // each histogram) so that we can record only the delta with the next log. | 50 // each histogram) so that we can record only the delta with the next log. |
51 std::map<std::string, HistogramSamples*> logged_samples_; | 51 // The information is indexed by the hash of the histogram name. |
| 52 std::map<uint64_t, HistogramSamples*> logged_samples_; |
52 | 53 |
53 // List of histograms found to be corrupt, and their problems. | 54 // Set of histograms found to be corrupt and their problems, indexed |
54 std::map<std::string, int> inconsistencies_; | 55 // by the hash of the histogram name. |
| 56 std::map<uint64_t, int> inconsistencies_; |
55 | 57 |
56 // |histogram_flattener_| handles the logistics of recording the histogram | 58 // |histogram_flattener_| handles the logistics of recording the histogram |
57 // deltas. | 59 // deltas. |
58 HistogramFlattener* histogram_flattener_; // Weak. | 60 HistogramFlattener* histogram_flattener_; // Weak. |
59 | 61 |
60 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); | 62 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); |
61 }; | 63 }; |
62 | 64 |
63 } // namespace base | 65 } // namespace base |
64 | 66 |
65 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ | 67 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ |
OLD | NEW |