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

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

Issue 1083603002: Add histograms to record the number of writes to the prefs file (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 months 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 | « no previous file | base/metrics/statistics_recorder.cc » ('j') | base/prefs/json_pref_store.h » ('J')
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 // StatisticsRecorder holds all Histograms and BucketRanges that are used by 5 // StatisticsRecorder holds all Histograms and BucketRanges that are used by
6 // Histograms in the system. It provides a general place for 6 // Histograms in the system. It provides a general place for
7 // Histograms/BucketRanges to register, and supports a global API for accessing 7 // Histograms/BucketRanges to register, and supports a global API for accessing
8 // (i.e., dumping, or graphing) the data. 8 // (i.e., dumping, or graphing) the data.
9 9
10 #ifndef BASE_METRICS_STATISTICS_RECORDER_H_ 10 #ifndef BASE_METRICS_STATISTICS_RECORDER_H_
(...skipping 15 matching lines...) Expand all
26 class HistogramBase; 26 class HistogramBase;
27 class Lock; 27 class Lock;
28 28
29 class BASE_EXPORT StatisticsRecorder { 29 class BASE_EXPORT StatisticsRecorder {
30 public: 30 public:
31 typedef std::vector<HistogramBase*> Histograms; 31 typedef std::vector<HistogramBase*> Histograms;
32 32
33 // Initializes the StatisticsRecorder system. Safe to call multiple times. 33 // Initializes the StatisticsRecorder system. Safe to call multiple times.
34 static void Initialize(); 34 static void Initialize();
35 35
36 // Initializes the StatisticsRecorder system for testing. This will reset all
37 // existing histogram data.
38 static void InitializeForTest();
Alexei Svitkine (slow) 2015/04/24 16:34:47 This sounds like Reset rather than initialize. Als
raymes 2015/04/27 03:27:54 Done.
39
36 // Find out if histograms can now be registered into our list. 40 // Find out if histograms can now be registered into our list.
37 static bool IsActive(); 41 static bool IsActive();
38 42
39 // Register, or add a new histogram to the collection of statistics. If an 43 // Register, or add a new histogram to the collection of statistics. If an
40 // identically named histogram is already registered, then the argument 44 // identically named histogram is already registered, then the argument
41 // |histogram| will deleted. The returned value is always the registered 45 // |histogram| will deleted. The returned value is always the registered
42 // histogram (either the argument, or the pre-existing registered histogram). 46 // histogram (either the argument, or the pre-existing registered histogram).
43 static HistogramBase* RegisterOrDeleteDuplicate(HistogramBase* histogram); 47 static HistogramBase* RegisterOrDeleteDuplicate(HistogramBase* histogram);
44 48
45 // Register, or add a new BucketRanges. If an identically BucketRanges is 49 // Register, or add a new BucketRanges. If an identically BucketRanges is
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
106 110
107 // Lock protects access to above maps. 111 // Lock protects access to above maps.
108 static base::Lock* lock_; 112 static base::Lock* lock_;
109 113
110 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); 114 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder);
111 }; 115 };
112 116
113 } // namespace base 117 } // namespace base
114 118
115 #endif // BASE_METRICS_STATISTICS_RECORDER_H_ 119 #endif // BASE_METRICS_STATISTICS_RECORDER_H_
OLDNEW
« no previous file with comments | « no previous file | base/metrics/statistics_recorder.cc » ('j') | base/prefs/json_pref_store.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698