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_ |
11 #define BASE_METRICS_STATISTICS_RECORDER_H_ | 11 #define BASE_METRICS_STATISTICS_RECORDER_H_ |
12 | 12 |
13 #include <stdint.h> | 13 #include <stdint.h> |
14 | 14 |
15 #include <list> | 15 #include <list> |
16 #include <map> | 16 #include <map> |
17 #include <memory> | 17 #include <memory> |
18 #include <string> | 18 #include <string> |
19 #include <vector> | 19 #include <vector> |
20 | 20 |
21 #include "base/base_export.h" | 21 #include "base/base_export.h" |
22 #include "base/callback.h" | 22 #include "base/callback.h" |
23 #include "base/gtest_prod_util.h" | 23 #include "base/gtest_prod_util.h" |
24 #include "base/lazy_instance.h" | 24 #include "base/lazy_instance.h" |
25 #include "base/macros.h" | 25 #include "base/macros.h" |
26 #include "base/metrics/histogram_base.h" | 26 #include "base/metrics/histogram_base.h" |
27 #include "base/strings/string_piece.h" | 27 #include "base/strings/string_piece.h" |
28 | 28 |
29 class SubprocessMetricsProviderTest; | |
30 | |
31 namespace base { | 29 namespace base { |
32 | 30 |
33 class BucketRanges; | 31 class BucketRanges; |
34 class Lock; | 32 class Lock; |
35 | 33 |
36 class BASE_EXPORT StatisticsRecorder { | 34 class BASE_EXPORT StatisticsRecorder { |
37 public: | 35 public: |
38 // A class used as a key for the histogram map below. It always references | 36 // A class used as a key for the histogram map below. It always references |
39 // a string owned outside of this class, likely in the value of the map. | 37 // a string owned outside of this class, likely in the value of the map. |
40 class StringKey : public StringPiece { | 38 class StringKey : public StringPiece { |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 | 232 |
235 // Lock protects access to above maps. | 233 // Lock protects access to above maps. |
236 static base::Lock* lock_; | 234 static base::Lock* lock_; |
237 | 235 |
238 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); | 236 DISALLOW_COPY_AND_ASSIGN(StatisticsRecorder); |
239 }; | 237 }; |
240 | 238 |
241 } // namespace base | 239 } // namespace base |
242 | 240 |
243 #endif // BASE_METRICS_STATISTICS_RECORDER_H_ | 241 #endif // BASE_METRICS_STATISTICS_RECORDER_H_ |
OLD | NEW |