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

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: addressed review comments by Alexei 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
« no previous file with comments | « base/metrics/histogram_samples.cc ('k') | 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_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 // 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_
OLDNEW
« no previous file with comments | « base/metrics/histogram_samples.cc ('k') | base/metrics/histogram_snapshot_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698