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

Unified Diff: cc/base/histograms.h

Issue 1878323004: Add an uma stat to time Pending Tree activation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/histograms.h
diff --git a/cc/base/histograms.h b/cc/base/histograms.h
index 6614f73ef65307980a473af448a36f00c93ac201..a4c0c58cc90ee36dbe70605d6be194af06a2f7e8 100644
--- a/cc/base/histograms.h
+++ b/cc/base/histograms.h
@@ -50,14 +50,14 @@ const char* GetClientNameForMetrics();
//
#define DEFINE_SCOPED_UMA_HISTOGRAM_AREA_TIMER(class_name, time_histogram, \
area_histogram) \
- class class_name : public ::cc::ScopedUMAHistogramAreaTimerBase { \
+ class class_name : public ScopedUMAHistogramAreaTimerBase { \
public: \
~class_name(); \
}; \
class_name::~class_name() { \
Sample time_sample; \
Sample area_sample; \
- const char* client_name = ::cc::GetClientNameForMetrics(); \
+ 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 */ \
@@ -69,6 +69,26 @@ const char* GetClientNameForMetrics();
} \
}
+// 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); \
+ } \
+ }
+
class CC_EXPORT ScopedUMAHistogramAreaTimerBase {
public:
void AddArea(const base::CheckedNumeric<int>& area) { area_ += area; }
« no previous file with comments | « no previous file | cc/trees/layer_tree_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698