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

Unified Diff: cc/trees/layer_tree_host_impl.cc

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 | « cc/trees/layer_tree_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: cc/trees/layer_tree_host_impl.cc
diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc
index 91ae9ab9340c01911f0369b3ff9072dc65694e82..563ed6030986b563aeb7e33a1afa526135034a8d 100644
--- a/cc/trees/layer_tree_host_impl.cc
+++ b/cc/trees/layer_tree_host_impl.cc
@@ -164,6 +164,9 @@ void RecordCompositorSlowScrollMetric(InputHandler::ScrollInputType type,
} // namespace
+DEFINE_SCOPED_UMA_HISTOGRAM_TIMER(PendingTreeDurationHistogramTimer,
+ "Scheduling.%s.PendingTreeDuration");
+
LayerTreeHostImpl::FrameData::FrameData()
: render_surface_layer_list(nullptr), has_no_damage(false) {}
@@ -1960,12 +1963,19 @@ void LayerTreeHostImpl::CreatePendingTree() {
client_->OnCanDrawStateChanged(CanDraw());
TRACE_EVENT_ASYNC_BEGIN0("cc", "PendingTree:waiting", pending_tree_.get());
+
+ DCHECK(!pending_tree_duration_timer_);
+ pending_tree_duration_timer_.reset(new PendingTreeDurationHistogramTimer());
}
void LayerTreeHostImpl::ActivateSyncTree() {
if (pending_tree_) {
TRACE_EVENT_ASYNC_END0("cc", "PendingTree:waiting", pending_tree_.get());
+ DCHECK(pending_tree_duration_timer_);
+ // Reset will call the destructor and log the timer histogram.
+ pending_tree_duration_timer_.reset();
+
// Process any requests in the UI resource queue. The request queue is
// given in LayerTreeHost::FinishCommitOnImplThread. This must take place
// before the swap.
« no previous file with comments | « cc/trees/layer_tree_host_impl.h ('k') | tools/metrics/histograms/histograms.xml » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698