OLD | NEW |
---|---|
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 Histogram_h | 5 #ifndef Histogram_h |
6 #define Histogram_h | 6 #define Histogram_h |
7 | 7 |
8 #include "base/metrics/histogram_base.h" | 8 #include "base/metrics/histogram_base.h" |
9 #include "platform/PlatformExport.h" | 9 #include "platform/PlatformExport.h" |
10 #include "wtf/CurrentTime.h" | 10 #include "wtf/CurrentTime.h" |
(...skipping 17 matching lines...) Expand all Loading... | |
28 }; | 28 }; |
29 | 29 |
30 class PLATFORM_EXPORT BooleanHistogram : public CustomCountHistogram { | 30 class PLATFORM_EXPORT BooleanHistogram : public CustomCountHistogram { |
31 public: | 31 public: |
32 BooleanHistogram(const char* name); | 32 BooleanHistogram(const char* name); |
33 }; | 33 }; |
34 | 34 |
35 class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram { | 35 class PLATFORM_EXPORT EnumerationHistogram : public CustomCountHistogram { |
36 public: | 36 public: |
37 EnumerationHistogram(const char* name, base::HistogramBase::Sample boundaryV alue); | 37 EnumerationHistogram(const char* name, base::HistogramBase::Sample boundaryV alue); |
38 | |
39 static bool GetHistogramCount(const char* name, base::HistogramBase::Sample bucket, int32_t* count); | |
Ilya Sherman
2016/07/11 18:52:31
I'd recommend adding a "ForTesting" suffix to any
| |
38 }; | 40 }; |
39 | 41 |
40 class PLATFORM_EXPORT SparseHistogram { | 42 class PLATFORM_EXPORT SparseHistogram { |
41 public: | 43 public: |
42 explicit SparseHistogram(const char* name); | 44 explicit SparseHistogram(const char* name); |
43 | 45 |
44 void sample(base::HistogramBase::Sample); | 46 void sample(base::HistogramBase::Sample); |
45 | 47 |
46 private: | 48 private: |
47 base::HistogramBase* m_histogram; | 49 base::HistogramBase* m_histogram; |
(...skipping 26 matching lines...) Expand all Loading... | |
74 // } | 76 // } |
75 // This macro records all times between 0us and 10 seconds. | 77 // This macro records all times between 0us and 10 seconds. |
76 // Do not change this macro without renaming all metrics that use it! | 78 // Do not change this macro without renaming all metrics that use it! |
77 #define SCOPED_BLINK_UMA_HISTOGRAM_TIMER(name) \ | 79 #define SCOPED_BLINK_UMA_HISTOGRAM_TIMER(name) \ |
78 DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, (name, 0, 10000000, 5 0)); \ | 80 DEFINE_STATIC_LOCAL(CustomCountHistogram, scopedUsCounter, (name, 0, 10000000, 5 0)); \ |
79 ScopedUsHistogramTimer timer(scopedUsCounter); | 81 ScopedUsHistogramTimer timer(scopedUsCounter); |
80 | 82 |
81 } // namespace blink | 83 } // namespace blink |
82 | 84 |
83 #endif // Histogram_h | 85 #endif // Histogram_h |
OLD | NEW |