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

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

Issue 2261793002: Bring the feedback button to the Mac sad tab (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Ditch a pointless |explicit|, add a comment on SadTabView ownership. Created 4 years, 3 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/template_util.h » ('j') | base/template_util.h » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 BASE_METRICS_HISTOGRAM_MACROS_H_ 5 #ifndef BASE_METRICS_HISTOGRAM_MACROS_H_
6 #define BASE_METRICS_HISTOGRAM_MACROS_H_ 6 #define BASE_METRICS_HISTOGRAM_MACROS_H_
7 7
8 #include "base/atomicops.h" 8 #include "base/atomicops.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/template_util.h"
11 #include "base/time/time.h" 12 #include "base/time/time.h"
12 13
13 // Macros for efficient use of histograms. See documentation in histogram.h. 14 // Macros for efficient use of histograms. See documentation in histogram.h.
14 // 15 //
15 // UMA_HISTOGRAM_SPARSE_SLOWLY is defined in sparse_histogram.h as it has 16 // UMA_HISTOGRAM_SPARSE_SLOWLY is defined in sparse_histogram.h as it has
16 // different #include dependencies. 17 // different #include dependencies.
17 18
18 //------------------------------------------------------------------------------ 19 //------------------------------------------------------------------------------
19 // Histograms are often put in areas where they are called many many times, and 20 // Histograms are often put in areas where they are called many many times, and
20 // performance is critical. As a result, they are designed to have a very low 21 // performance is critical. As a result, they are designed to have a very low
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 #define LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \ 143 #define LOCAL_HISTOGRAM_CUSTOM_COUNTS(name, sample, min, max, bucket_count) \
143 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ 144 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \
144 base::Histogram::FactoryGet(name, min, max, bucket_count, \ 145 base::Histogram::FactoryGet(name, min, max, bucket_count, \
145 base::HistogramBase::kNoFlags)) 146 base::HistogramBase::kNoFlags))
146 147
147 // This is a helper macro used by other macros and shouldn't be used directly. 148 // This is a helper macro used by other macros and shouldn't be used directly.
148 // One additional bucket is created in the LinearHistogram for the illegal 149 // One additional bucket is created in the LinearHistogram for the illegal
149 // values >= boundary_value so that mistakes in calling the UMA enumeration 150 // values >= boundary_value so that mistakes in calling the UMA enumeration
150 // macros can be detected. 151 // macros can be detected.
151 #define HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary, flag) \ 152 #define HISTOGRAM_ENUMERATION_WITH_FLAG(name, sample, boundary, flag) \
152 STATIC_HISTOGRAM_POINTER_BLOCK(name, Add(sample), \ 153 STATIC_HISTOGRAM_POINTER_BLOCK( \
153 base::LinearHistogram::FactoryGet(name, 1, boundary, boundary + 1, \ 154 name, Add(base::underlying_value(sample)), \
154 flag)) 155 base::LinearHistogram::FactoryGet( \
156 name, 1, base::underlying_value(boundary), \
157 base::underlying_value(boundary) + 1, flag))
155 158
156 #define LOCAL_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \ 159 #define LOCAL_HISTOGRAM_PERCENTAGE(name, under_one_hundred) \
157 LOCAL_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101) 160 LOCAL_HISTOGRAM_ENUMERATION(name, under_one_hundred, 101)
158 161
159 #define LOCAL_HISTOGRAM_BOOLEAN(name, sample) \ 162 #define LOCAL_HISTOGRAM_BOOLEAN(name, sample) \
160 STATIC_HISTOGRAM_POINTER_BLOCK(name, AddBoolean(sample), \ 163 STATIC_HISTOGRAM_POINTER_BLOCK(name, AddBoolean(sample), \
161 base::BooleanHistogram::FactoryGet(name, base::Histogram::kNoFlags)) 164 base::BooleanHistogram::FactoryGet(name, base::Histogram::kNoFlags))
162 165
163 // Support histograming of an enumerated value. The samples should always be 166 // Support histograming of an enumerated value. The samples should always be
164 // strictly less than |boundary_value| -- this prevents you from running into 167 // strictly less than |boundary_value| -- this prevents you from running into
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after
294 UMA_HISTOGRAM_LONG_TIMES_100(name, elapsed); \ 297 UMA_HISTOGRAM_LONG_TIMES_100(name, elapsed); \
295 } else { \ 298 } else { \
296 UMA_HISTOGRAM_TIMES(name, elapsed); \ 299 UMA_HISTOGRAM_TIMES(name, elapsed); \
297 } \ 300 } \
298 } \ 301 } \
299 private: \ 302 private: \
300 base::TimeTicks constructed_; \ 303 base::TimeTicks constructed_; \
301 } scoped_histogram_timer_##key 304 } scoped_histogram_timer_##key
302 305
303 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_ 306 #endif // BASE_METRICS_HISTOGRAM_MACROS_H_
OLDNEW
« no previous file with comments | « no previous file | base/template_util.h » ('j') | base/template_util.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698