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

Unified Diff: cc/trees/layer_tree_host_in_process.cc

Issue 2484743002: UMA metric for LayerUpdateTimes (Closed)
Patch Set: UMA metric for LayerUpdateTimes and understand the impact of number of layers on it Created 4 years, 1 month 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
Index: cc/trees/layer_tree_host_in_process.cc
diff --git a/cc/trees/layer_tree_host_in_process.cc b/cc/trees/layer_tree_host_in_process.cc
index 57e2ea414e8bda672595b1955847274a3fc862d6..3c133bb260dfdeff280372f35a14a91eaade0af6 100644
--- a/cc/trees/layer_tree_host_in_process.cc
+++ b/cc/trees/layer_tree_host_in_process.cc
@@ -24,6 +24,7 @@
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
+#include "base/timer/elapsed_timer.h"
#include "base/trace_event/trace_event.h"
#include "base/trace_event/trace_event_argument.h"
#include "cc/animation/animation_events.h"
@@ -719,8 +720,20 @@ bool LayerTreeHostInProcess::UpdateLayers() {
if (!layer_tree_->root_layer())
return false;
DCHECK(!layer_tree_->root_layer()->parent());
+ base::ElapsedTimer timer;
+
bool result = DoUpdateLayers(layer_tree_->root_layer());
micro_benchmark_controller_.DidUpdateLayers();
+
+ std::string histogram_name = base::StringPrintf(
+ "Compositing.Renderer.LayersUpdateTime.%" PRIuS,
+ std::min(static_cast<size_t>(400), layer_tree_->NumLayers()) / 50);
majidvp 2016/11/15 13:10:55 In the current patch I have a simple equal buckets
flackr 2016/11/16 16:56:50 You mean 50 wide?
majidvp 2016/12/02 20:03:31 Fair enough, I changed my bucketization to an expo
+ base::Histogram::FactoryTimeGet(
+ histogram_name, base::TimeDelta::FromMilliseconds(1),
+ base::TimeDelta::FromSeconds(10), 50,
+ base::HistogramBase::kUmaTargetedHistogramFlag)
+ ->AddTime(timer.Elapsed());
+
return result || next_commit_forces_redraw_;
}

Powered by Google App Engine
This is Rietveld 408576698