Commit ee395f2a authored by Ria Jiang's avatar Ria Jiang Committed by Commit Bot

Collect metrics in HitTestAggregator and HitTestQuery.

Collect Event.VizHitTest.AggregateTime, Event.VizHitTest.HitTestRegions,
Event.VizHitTest.TargetTime and Event.VizHitTest.TransformTime.

Bug: 817673
Cq-Include-Trybots: master.tryserver.chromium.android:android_optional_gpu_tests_rel
Change-Id: Iaae1009aa74f679a2e40c56f62e24a6fb3422be4
Reviewed-on: https://chromium-review.googlesource.com/942604
Commit-Queue: Ria Jiang <riajiang@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Reviewed-by: default avatarSadrul Chowdhury <sadrul@chromium.org>
Cr-Commit-Position: refs/heads/master@{#540270}
parent c6b0ef26
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "components/viz/host/hit_test/hit_test_query.h" #include "components/viz/host/hit_test/hit_test_query.h"
#include "base/metrics/histogram_macros.h"
#include "services/viz/public/interfaces/hit_test/hit_test_region_list.mojom.h" #include "services/viz/public/interfaces/hit_test/hit_test_region_list.mojom.h"
#include "ui/gfx/geometry/point_conversions.h" #include "ui/gfx/geometry/point_conversions.h"
...@@ -53,6 +54,8 @@ void HitTestQuery::SwitchActiveAggregatedHitTestRegionList( ...@@ -53,6 +54,8 @@ void HitTestQuery::SwitchActiveAggregatedHitTestRegionList(
Target HitTestQuery::FindTargetForLocation( Target HitTestQuery::FindTargetForLocation(
EventSource event_source, EventSource event_source,
const gfx::PointF& location_in_root) const { const gfx::PointF& location_in_root) const {
SCOPED_UMA_HISTOGRAM_TIMER("Event.VizHitTest.TargetTime");
Target target; Target target;
if (!active_hit_test_list_size_) if (!active_hit_test_list_size_)
return target; return target;
...@@ -66,6 +69,8 @@ gfx::PointF HitTestQuery::TransformLocationForTarget( ...@@ -66,6 +69,8 @@ gfx::PointF HitTestQuery::TransformLocationForTarget(
EventSource event_source, EventSource event_source,
const std::vector<FrameSinkId>& target_ancestors, const std::vector<FrameSinkId>& target_ancestors,
const gfx::PointF& location_in_root) const { const gfx::PointF& location_in_root) const {
SCOPED_UMA_HISTOGRAM_TIMER("Event.VizHitTest.TransformTime");
if (!active_hit_test_list_size_) if (!active_hit_test_list_size_)
return location_in_root; return location_in_root;
......
...@@ -4,6 +4,7 @@ ...@@ -4,6 +4,7 @@
#include "components/viz/service/hit_test/hit_test_aggregator.h" #include "components/viz/service/hit_test/hit_test_aggregator.h"
#include "base/metrics/histogram_macros.h"
#include "components/viz/common/hit_test/aggregated_hit_test_region.h" #include "components/viz/common/hit_test/aggregated_hit_test_region.h"
#include "components/viz/service/hit_test/hit_test_aggregator_delegate.h" #include "components/viz/service/hit_test/hit_test_aggregator_delegate.h"
#include "third_party/skia/include/core/SkMatrix44.h" #include "third_party/skia/include/core/SkMatrix44.h"
...@@ -103,6 +104,8 @@ void HitTestAggregator::SwapHandles() { ...@@ -103,6 +104,8 @@ void HitTestAggregator::SwapHandles() {
} }
void HitTestAggregator::AppendRoot(const SurfaceId& surface_id) { void HitTestAggregator::AppendRoot(const SurfaceId& surface_id) {
SCOPED_UMA_HISTOGRAM_TIMER("Event.VizHitTest.AggregateTime");
const mojom::HitTestRegionList* hit_test_region_list = const mojom::HitTestRegionList* hit_test_region_list =
hit_test_manager_->GetActiveHitTestRegionList(surface_id); hit_test_manager_->GetActiveHitTestRegionList(surface_id);
if (!hit_test_region_list) if (!hit_test_region_list)
...@@ -117,6 +120,7 @@ void HitTestAggregator::AppendRoot(const SurfaceId& surface_id) { ...@@ -117,6 +120,7 @@ void HitTestAggregator::AppendRoot(const SurfaceId& surface_id) {
DCHECK_GE(region_index, 1u); DCHECK_GE(region_index, 1u);
int32_t child_count = region_index - 1; int32_t child_count = region_index - 1;
UMA_HISTOGRAM_COUNTS_1000("Event.VizHitTest.HitTestRegions", region_index);
SetRegionAt(0, surface_id.frame_sink_id(), hit_test_region_list->flags, SetRegionAt(0, surface_id.frame_sink_id(), hit_test_region_list->flags,
hit_test_region_list->bounds, hit_test_region_list->transform, hit_test_region_list->bounds, hit_test_region_list->transform,
child_count); child_count);
......
...@@ -22563,6 +22563,41 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries. ...@@ -22563,6 +22563,41 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary> </summary>
</histogram> </histogram>
<histogram name="Event.VizHitTest.AggregateTime" units="ms">
<owner>riajiang@chromium.org</owner>
<owner>event-targeting@chromium.org</owner>
<summary>
Tracks how long it takes for HitTestAggregator to aggregate hit-test data
received from all clients.
</summary>
</histogram>
<histogram name="Event.VizHitTest.HitTestRegions" units="regions">
<owner>riajiang@chromium.org</owner>
<owner>event-targeting@chromium.org</owner>
<summary>
Total number of hit-test regions Viz received from all clients.
</summary>
</histogram>
<histogram name="Event.VizHitTest.TargetTime" units="ms">
<owner>riajiang@chromium.org</owner>
<owner>event-targeting@chromium.org</owner>
<summary>
Tracks how long it takes for HitTestQuery to find a target on a given
location.
</summary>
</histogram>
<histogram name="Event.VizHitTest.TransformTime" units="ms">
<owner>riajiang@chromium.org</owner>
<owner>event-targeting@chromium.org</owner>
<summary>
Tracks how long it takes for HitTestQuery to transform a location to a given
target's coordinate space.
</summary>
</histogram>
<histogram name="ExclusiveAccess.BubbleReshowsPerSession.Fullscreen"> <histogram name="ExclusiveAccess.BubbleReshowsPerSession.Fullscreen">
<owner>mgiuca@chromium.org</owner> <owner>mgiuca@chromium.org</owner>
<summary> <summary>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment