diff options
Diffstat (limited to 'chromium/cc/base/histograms.h')
-rw-r--r-- | chromium/cc/base/histograms.h | 74 |
1 files changed, 37 insertions, 37 deletions
diff --git a/chromium/cc/base/histograms.h b/chromium/cc/base/histograms.h index 5c634b9cc11..dd88f8c04d4 100644 --- a/chromium/cc/base/histograms.h +++ b/chromium/cc/base/histograms.h @@ -48,46 +48,46 @@ CC_BASE_EXPORT const char* GetClientNameForMetrics(); // ScopedReticulateSplinesTimer timer; // timer.AddArea(some_rect.size().GetArea()); // -#define DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(class_name, time_histogram, \ - area_histogram) \ - class class_name : public ScopedUMAHistogramAreaTimerBase { \ - public: \ - ~class_name(); \ - }; \ - class_name::~class_name() { \ - Sample time_sample; \ - Sample area_sample; \ - const char* client_name = GetClientNameForMetrics(); \ - if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ - /* GetClientNameForMetrics only returns one non-null value over */ \ - /* the lifetime of the process, so these histogram names are */ \ - /* runtime constant. */ \ - UMA_HISTOGRAM_COUNTS(base::StringPrintf(time_histogram, client_name), \ - time_sample); \ - UMA_HISTOGRAM_CUSTOM_COUNTS( \ - base::StringPrintf(area_histogram, client_name), area_sample, 1, \ - 100000000, 50); \ - } \ +#define DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(class_name, time_histogram, \ + area_histogram) \ + class class_name : public ScopedUMAHistogramAreaTimerBase { \ + public: \ + ~class_name(); \ + }; \ + class_name::~class_name() { \ + Sample time_sample; \ + Sample area_sample; \ + const char* client_name = GetClientNameForMetrics(); \ + if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ + /* GetClientNameForMetrics only returns one non-null value over */ \ + /* the lifetime of the process, so these histogram names are */ \ + /* runtime constant. */ \ + UMA_HISTOGRAM_COUNTS_1M(base::StringPrintf(time_histogram, client_name), \ + time_sample); \ + UMA_HISTOGRAM_CUSTOM_COUNTS( \ + base::StringPrintf(area_histogram, client_name), area_sample, 1, \ + 100000000, 50); \ + } \ } // Version of the above macro for cases which only care about time, not area. -#define DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(class_name, time_histogram) \ - class class_name : public ScopedUMAHistogramAreaTimerBase { \ - public: \ - ~class_name(); \ - }; \ - class_name::~class_name() { \ - Sample time_sample; \ - Sample area_sample; \ - const char* client_name = GetClientNameForMetrics(); \ - if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ - DCHECK_EQ(0, area_sample); \ - /* GetClientNameForMetrics only returns one non-null value over */ \ - /* the lifetime of the process, so these histogram names are */ \ - /* runtime constant. */ \ - UMA_HISTOGRAM_COUNTS(base::StringPrintf(time_histogram, client_name), \ - time_sample); \ - } \ +#define DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(class_name, time_histogram) \ + class class_name : public ScopedUMAHistogramAreaTimerBase { \ + public: \ + ~class_name(); \ + }; \ + class_name::~class_name() { \ + Sample time_sample; \ + Sample area_sample; \ + const char* client_name = GetClientNameForMetrics(); \ + if (client_name && GetHistogramValues(&time_sample, &area_sample)) { \ + DCHECK_EQ(0, area_sample); \ + /* GetClientNameForMetrics only returns one non-null value over */ \ + /* the lifetime of the process, so these histogram names are */ \ + /* runtime constant. */ \ + UMA_HISTOGRAM_COUNTS_1M(base::StringPrintf(time_histogram, client_name), \ + time_sample); \ + } \ } class CC_BASE_EXPORT ScopedUMAHistogramAreaTimerBase { |