Chromium Code Reviews| 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 // 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 Loading... | |
| 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 // Reset the StatisticsRecorder system for testing. All existing histogram | |
|
Alexei Svitkine (slow)
2015/04/27 20:21:20
Nit: Reset -> Resets
To be consistent with the do
raymes
2015/04/28 00:32:57
Done.
| |
| 37 // data will be erased. | |
| 38 static void ResetForTesting(); | |
| 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 Loading... | |
| 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_ |
| OLD | NEW |