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

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

Issue 1471073007: Reorganize histograms for persistence. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shmem-alloc
Patch Set: added GN changes Created 5 years 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
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_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
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 std::map<uint64_t, HistogramSamples*> logged_samples_;
52 52
53 // List of histograms found to be corrupt, and their problems. 53 // List of histograms found to be corrupt, and their problems.
54 std::map<std::string, int> inconsistencies_; 54 std::map<uint64_t, int> inconsistencies_;
55 55
56 // |histogram_flattener_| handles the logistics of recording the histogram 56 // |histogram_flattener_| handles the logistics of recording the histogram
57 // deltas. 57 // deltas.
58 HistogramFlattener* histogram_flattener_; // Weak. 58 HistogramFlattener* histogram_flattener_; // Weak.
59 59
60 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager); 60 DISALLOW_COPY_AND_ASSIGN(HistogramSnapshotManager);
61 }; 61 };
62 62
63 } // namespace base 63 } // namespace base
64 64
65 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_ 65 #endif // BASE_METRICS_HISTOGRAM_SNAPSHOT_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698