From 43dd14a56904fdb03e9a7583061341b772ba102e Mon Sep 17 00:00:00 2001 From: Sadrul Habib Chowdhury Date: Wed, 18 Sep 2019 20:13:37 +0000 Subject: [PATCH] cc metrics: Do not report throughput UMA for ui compositor. Stop reporting the throughput metrics for the UI compositor, since it is currently bundled with the throughput metrics for the renderer. We could report these separately, but it's not clear that these would be used for monitoring the UI performance. BUG=1005226 Change-Id: Ia1572010737a66ecba114cfbb96239f822c1ea92 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1810014 Reviewed-by: Behdad Bakhshinategh Commit-Queue: Sadrul Chowdhury Cr-Commit-Position: refs/heads/master@{#697747} --- cc/metrics/frame_sequence_tracker.cc | 6 +++++- cc/metrics/frame_sequence_tracker.h | 6 ++++-- cc/metrics/frame_sequence_tracker_unittest.cc | 3 ++- cc/trees/layer_tree_host_impl.cc | 3 ++- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/cc/metrics/frame_sequence_tracker.cc b/cc/metrics/frame_sequence_tracker.cc index 31dce1de19c1a0..230045402cd3f2 100644 --- a/cc/metrics/frame_sequence_tracker.cc +++ b/cc/metrics/frame_sequence_tracker.cc @@ -67,8 +67,10 @@ std::string GetFrameSequenceLengthHistogramName(FrameSequenceTrackerType type) { // FrameSequenceTrackerCollection FrameSequenceTrackerCollection::FrameSequenceTrackerCollection( + bool is_single_threaded, CompositorFrameReportingController* compositor_frame_reporting_controller) - : compositor_frame_reporting_controller_( + : is_single_threaded_(is_single_threaded), + compositor_frame_reporting_controller_( compositor_frame_reporting_controller) { StartSequence(FrameSequenceTrackerType::kUniversal); } @@ -80,6 +82,8 @@ FrameSequenceTrackerCollection::~FrameSequenceTrackerCollection() { void FrameSequenceTrackerCollection::StartSequence( FrameSequenceTrackerType type) { + if (is_single_threaded_) + return; if (frame_trackers_.contains(type)) return; auto tracker = base::WrapUnique(new FrameSequenceTracker(type)); diff --git a/cc/metrics/frame_sequence_tracker.h b/cc/metrics/frame_sequence_tracker.h index 685018ec21c9d8..2adac7ee64119b 100644 --- a/cc/metrics/frame_sequence_tracker.h +++ b/cc/metrics/frame_sequence_tracker.h @@ -48,8 +48,9 @@ enum FrameSequenceTrackerType { // submitted frames. class CC_EXPORT FrameSequenceTrackerCollection { public: - explicit FrameSequenceTrackerCollection( - CompositorFrameReportingController* = nullptr); + FrameSequenceTrackerCollection( + bool is_single_threaded, + CompositorFrameReportingController* frame_reporting_controller); ~FrameSequenceTrackerCollection(); FrameSequenceTrackerCollection(const FrameSequenceTrackerCollection&) = @@ -95,6 +96,7 @@ class CC_EXPORT FrameSequenceTrackerCollection { private: friend class FrameSequenceTrackerTest; + const bool is_single_threaded_; // The callsite can use the type to manipulate the tracker. base::flat_map> diff --git a/cc/metrics/frame_sequence_tracker_unittest.cc b/cc/metrics/frame_sequence_tracker_unittest.cc index a597e4823927db..1c492dbbabfb58 100644 --- a/cc/metrics/frame_sequence_tracker_unittest.cc +++ b/cc/metrics/frame_sequence_tracker_unittest.cc @@ -22,7 +22,8 @@ class FrameSequenceTrackerTest : public testing::Test { FrameSequenceTrackerTest() : compositor_frame_reporting_controller_( std::make_unique()), - collection_(compositor_frame_reporting_controller_.get()) { + collection_(/* is_single_threaded=*/false, + compositor_frame_reporting_controller_.get()) { collection_.StartSequence(FrameSequenceTrackerType::kTouchScroll); tracker_ = collection_.GetTrackerForTesting( FrameSequenceTrackerType::kTouchScroll); diff --git a/cc/trees/layer_tree_host_impl.cc b/cc/trees/layer_tree_host_impl.cc index 25ea491c5373d1..03b29b21e65e76 100644 --- a/cc/trees/layer_tree_host_impl.cc +++ b/cc/trees/layer_tree_host_impl.cc @@ -319,7 +319,8 @@ LayerTreeHostImpl::LayerTreeHostImpl( is_animating_for_snap_(false), paint_image_generator_client_id_(PaintImage::GetNextGeneratorClientId()), scrollbar_controller_(std::make_unique(this)), - frame_trackers_(compositor_frame_reporting_controller_.get()), + frame_trackers_(settings.single_thread_proxy_scheduler, + compositor_frame_reporting_controller_.get()), scroll_gesture_did_end_(false) { DCHECK(mutator_host_); mutator_host_->SetMutatorHostClient(this);