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

Side by Side Diff: third_party/WebKit/Source/platform/Histogram.h

Issue 2137483003: Add UMA metrics for root scroller intervention to track forcing passive breakage. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address nits Created 4 years, 5 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
OLDNEW
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
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698