diff options
author | Jeremy Roman <jbroman@chromium.org> | 2015-09-08 17:40:10 -0400 |
---|---|---|
committer | Jeremy Roman <jbroman@chromium.org> | 2015-09-08 21:41:32 +0000 |
commit | 83a44a77943a21f01abf6213765aee34de392b71 (patch) | |
tree | 9341131c3d489d335453a910d5e9731e849688d5 /cc/trees/layer_tree_host_impl.cc | |
parent | ebe85449f277b36d6ebda7d41a62b1172d1758d1 (diff) | |
download | chromium_src-83a44a77943a21f01abf6213765aee34de392b71.zip chromium_src-83a44a77943a21f01abf6213765aee34de392b71.tar.gz chromium_src-83a44a77943a21f01abf6213765aee34de392b71.tar.bz2 |
Track cc histograms using a global "client name" variable.
BUG=526192
CQ_INCLUDE_TRYBOTS=tryserver.blink:linux_blink_rel
Review URL: https://codereview.chromium.org/1321013004
Cr-Commit-Position: refs/heads/master@{#347565}
(cherry picked from commit 0d30216f14e3f5620de722412d76cbdb7759ec42)
TBR=chrishtr@chromium.org,wkorman@chromium.org
Review URL: https://codereview.chromium.org/1321913005 .
Cr-Commit-Position: refs/branch-heads/2490@{#189}
Cr-Branched-From: 7790a3535f2a81a03685eca31a32cf69ae0c114f-refs/heads/master@{#344925}
Diffstat (limited to 'cc/trees/layer_tree_host_impl.cc')
-rw-r--r-- | cc/trees/layer_tree_host_impl.cc | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index a3a9b2c..7fe2181 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -23,6 +23,7 @@ #include "cc/animation/scroll_offset_animation_curve.h" #include "cc/animation/scrollbar_animation_controller.h" #include "cc/animation/timing_function.h" +#include "cc/base/histograms.h" #include "cc/base/math_util.h" #include "cc/debug/benchmark_instrumentation.h" #include "cc/debug/debug_rect_history.h" @@ -1034,13 +1035,18 @@ DrawResult LayerTreeHostImpl::PrepareToDraw(FrameData* frame) { "Compositing.NumActiveLayers", base::saturated_cast<int>(active_tree_->NumLayers()), 1, 400, 20); - size_t total_picture_memory = 0; - for (const PictureLayerImpl* layer : active_tree()->picture_layers()) - total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); - if (total_picture_memory != 0) { - UMA_HISTOGRAM_COUNTS( - "Compositing.PictureMemoryUsageKb", - base::saturated_cast<int>(total_picture_memory / 1024)); + if (const char* client_name = GetClientNameForMetrics()) { + size_t total_picture_memory = 0; + for (const PictureLayerImpl* layer : active_tree()->picture_layers()) + total_picture_memory += layer->GetRasterSource()->GetPictureMemoryUsage(); + if (total_picture_memory != 0) { + // GetClientNameForMetrics only returns one non-null value over the + // lifetime of the process, so this histogram name is runtime constant. + UMA_HISTOGRAM_COUNTS( + base::StringPrintf("Compositing.%s.PictureMemoryUsageKb", + client_name), + base::saturated_cast<int>(total_picture_memory / 1024)); + } } bool update_lcd_text = false; |