Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 CC_BASE_HISTOGRAMS_H_ | 5 #ifndef CC_BASE_HISTOGRAMS_H_ |
| 6 #define CC_BASE_HISTOGRAMS_H_ | 6 #define CC_BASE_HISTOGRAMS_H_ |
| 7 | 7 |
| 8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/metrics/histogram_base.h" | 10 #include "base/metrics/histogram_base.h" |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 57 class_name::~class_name() { \ | 57 class_name::~class_name() { \ |
| 58 Sample time_sample; \ | 58 Sample time_sample; \ |
| 59 Sample area_sample; \ | 59 Sample area_sample; \ |
| 60 const char* client_name = GetClientNameForMetrics(); \ | 60 const char* client_name = GetClientNameForMetrics(); \ |
| 61 if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ | 61 if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ |
| 62 /* GetClientNameForMetrics only returns one non-null value over */ \ | 62 /* GetClientNameForMetrics only returns one non-null value over */ \ |
| 63 /* the lifetime of the process, so these histogram names are */ \ | 63 /* the lifetime of the process, so these histogram names are */ \ |
| 64 /* runtime constant. */ \ | 64 /* runtime constant. */ \ |
| 65 UMA_HISTOGRAM_COUNTS(base::StringPrintf(time_histogram, client_name), \ | 65 UMA_HISTOGRAM_COUNTS(base::StringPrintf(time_histogram, client_name), \ |
| 66 time_sample); \ | 66 time_sample); \ |
| 67 UMA_HISTOGRAM_COUNTS(base::StringPrintf(area_histogram, client_name), \ | 67 UMA_HISTOGRAM_CUSTOM_COUNTS( \ |
| 68 area_sample); \ | 68 base::StringPrintf(time_histogram, client_name), area_sample, 1, \ |
| 69 100000000, 50); \ | |
|
ericrk
2016/11/14 17:33:32
isherman@ - when we update the range of an existin
Ilya Sherman
2016/11/14 17:57:32
You should rename, yes. Otherwise, the dashboard
| |
| 69 } \ | 70 } \ |
| 70 } | 71 } |
| 71 | 72 |
| 72 // Version of the above macro for cases which only care about time, not area. | 73 // Version of the above macro for cases which only care about time, not area. |
| 73 #define DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(class_name, time_histogram) \ | 74 #define DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(class_name, time_histogram) \ |
| 74 class class_name : public ScopedUMAHistogramAreaTimerBase { \ | 75 class class_name : public ScopedUMAHistogramAreaTimerBase { \ |
| 75 public: \ | 76 public: \ |
| 76 ~class_name(); \ | 77 ~class_name(); \ |
| 77 }; \ | 78 }; \ |
| 78 class_name::~class_name() { \ | 79 class_name::~class_name() { \ |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 113 base::ElapsedTimer timer_; | 114 base::ElapsedTimer timer_; |
| 114 base::CheckedNumeric<int> area_; | 115 base::CheckedNumeric<int> area_; |
| 115 | 116 |
| 116 friend class ScopedUMAHistogramAreaTimerBaseTest; | 117 friend class ScopedUMAHistogramAreaTimerBaseTest; |
| 117 DISALLOW_COPY_AND_ASSIGN(ScopedUMAHistogramAreaTimerBase); | 118 DISALLOW_COPY_AND_ASSIGN(ScopedUMAHistogramAreaTimerBase); |
| 118 }; | 119 }; |
| 119 | 120 |
| 120 } // namespace cc | 121 } // namespace cc |
| 121 | 122 |
| 122 #endif // CC_BASE_HISTOGRAMS_H_ | 123 #endif // CC_BASE_HISTOGRAMS_H_ |
| OLD | NEW |