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

Unified Diff: cc/base/devtools_instrumentation.cc

Issue 2904743002: cc: Add UMA for tracking decode duration for out of raster decodes. (Closed)
Patch Set: move Created 3 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 | « cc/base/devtools_instrumentation.h ('k') | cc/tiles/gpu_image_decode_cache.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/base/devtools_instrumentation.cc
diff --git a/cc/base/devtools_instrumentation.cc b/cc/base/devtools_instrumentation.cc
index 010b16149f1459263c3938514eddacda4b1dd75d..cbf47b35d4f5d796172527648188fc494e43319e 100644
--- a/cc/base/devtools_instrumentation.cc
+++ b/cc/base/devtools_instrumentation.cc
@@ -30,5 +30,50 @@ extern const char kCompositeLayers[] = "CompositeLayers";
extern const char kPaintSetup[] = "PaintSetup";
extern const char kUpdateLayer[] = "UpdateLayer";
+ScopedImageDecodeTask::ScopedImageDecodeTask(const void* image_ptr,
+ DecodeType decode_type,
+ TaskType task_type)
+ : decode_type_(decode_type),
+ task_type_(task_type),
+ start_time_(base::TimeTicks::Now()) {
+ TRACE_EVENT_BEGIN1(internal::kCategory, internal::kImageDecodeTask,
+ internal::kPixelRefId,
+ reinterpret_cast<uint64_t>(image_ptr));
+}
+
+ScopedImageDecodeTask::~ScopedImageDecodeTask() {
+ TRACE_EVENT_END0(internal::kCategory, internal::kImageDecodeTask);
+ base::TimeDelta duration = base::TimeTicks::Now() - start_time_;
+ switch (task_type_) {
+ case kInRaster:
+ switch (decode_type_) {
+ case kSoftware:
+ UMA_HISTOGRAM_COUNTS_1M(
+ "Renderer4.ImageDecodeTaskDurationUs.Software",
+ duration.InMicroseconds());
+ break;
+ case kGpu:
+ UMA_HISTOGRAM_COUNTS_1M("Renderer4.ImageDecodeTaskDurationUs.Gpu",
+ duration.InMicroseconds());
+ break;
+ }
+ break;
+ case kOutOfRaster:
+ switch (decode_type_) {
+ case kSoftware:
+ UMA_HISTOGRAM_COUNTS_1M(
+ "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Software",
+ duration.InMicroseconds());
+ break;
+ case kGpu:
+ UMA_HISTOGRAM_COUNTS_1M(
+ "Renderer4.ImageDecodeTaskDurationUs.OutOfRaster.Gpu",
+ duration.InMicroseconds());
+ break;
+ }
+ break;
+ }
+}
+
} // namespace devtools_instrumentation
} // namespace cc
« no previous file with comments | « cc/base/devtools_instrumentation.h ('k') | cc/tiles/gpu_image_decode_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698