Commit 31f2fc33 authored by Stefan Zager's avatar Stefan Zager Committed by Chromium LUCI CQ

Add UpdateViewportIntersection UKM metric

Bug: 1149691
Change-Id: I9d89fed2bab361c8ea34d24ed0a42f40041b09d7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2593246
Commit-Queue: Stefan Zager <szager@chromium.org>
Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Reviewed-by: default avatarRobert Kaplow <rkaplow@chromium.org>
Cr-Commit-Position: refs/heads/master@{#840315}
parent 3bf822dc
...@@ -374,6 +374,7 @@ void LocalFrameUkmAggregator::ReportPreFCPEvent() { ...@@ -374,6 +374,7 @@ void LocalFrameUkmAggregator::ReportPreFCPEvent() {
CASE_FOR_ID(JavascriptIntersectionObserver); CASE_FOR_ID(JavascriptIntersectionObserver);
CASE_FOR_ID(LazyLoadIntersectionObserver); CASE_FOR_ID(LazyLoadIntersectionObserver);
CASE_FOR_ID(MediaIntersectionObserver); CASE_FOR_ID(MediaIntersectionObserver);
CASE_FOR_ID(UpdateViewportIntersection);
case kCount: case kCount:
case kMainFrame: case kMainFrame:
NOTREACHED(); NOTREACHED();
...@@ -424,6 +425,7 @@ void LocalFrameUkmAggregator::ReportUpdateTimeEvent() { ...@@ -424,6 +425,7 @@ void LocalFrameUkmAggregator::ReportUpdateTimeEvent() {
CASE_FOR_ID(JavascriptIntersectionObserver, i); CASE_FOR_ID(JavascriptIntersectionObserver, i);
CASE_FOR_ID(LazyLoadIntersectionObserver, i); CASE_FOR_ID(LazyLoadIntersectionObserver, i);
CASE_FOR_ID(MediaIntersectionObserver, i); CASE_FOR_ID(MediaIntersectionObserver, i);
CASE_FOR_ID(UpdateViewportIntersection, i);
case kCount: case kCount:
case kMainFrame: case kMainFrame:
NOTREACHED(); NOTREACHED();
......
...@@ -139,6 +139,7 @@ class CORE_EXPORT LocalFrameUkmAggregator ...@@ -139,6 +139,7 @@ class CORE_EXPORT LocalFrameUkmAggregator
kJavascriptIntersectionObserver, kJavascriptIntersectionObserver,
kLazyLoadIntersectionObserver, kLazyLoadIntersectionObserver,
kMediaIntersectionObserver, kMediaIntersectionObserver,
kUpdateViewportIntersection,
kCount, kCount,
kMainFrame kMainFrame
}; };
...@@ -175,7 +176,8 @@ class CORE_EXPORT LocalFrameUkmAggregator ...@@ -175,7 +176,8 @@ class CORE_EXPORT LocalFrameUkmAggregator
{"DisplayLockIntersectionObserver", true}, {"DisplayLockIntersectionObserver", true},
{"JavascriptIntersectionObserver", true}, {"JavascriptIntersectionObserver", true},
{"LazyLoadIntersectionObserver", true}, {"LazyLoadIntersectionObserver", true},
{"MediaIntersectionObserver", true}}; {"MediaIntersectionObserver", true},
{"UpdateViewportIntersection", true}};
static_assert(base::size(data) == kCount, "Metrics data mismatch"); static_assert(base::size(data) == kCount, "Metrics data mismatch");
return data; return data;
} }
......
...@@ -4353,7 +4353,12 @@ bool LocalFrameView::UpdateViewportIntersectionsForSubtree( ...@@ -4353,7 +4353,12 @@ bool LocalFrameView::UpdateViewportIntersectionsForSubtree(
intersection_observation_state_ = kNotNeeded; intersection_observation_state_ = kNotNeeded;
} }
UpdateViewportIntersection(flags, needs_occlusion_tracking); {
SCOPED_UMA_AND_UKM_TIMER(
EnsureUkmAggregator(),
LocalFrameUkmAggregator::kUpdateViewportIntersection);
UpdateViewportIntersection(flags, needs_occlusion_tracking);
}
for (Frame* child = frame_->Tree().FirstChild(); child; for (Frame* child = frame_->Tree().FirstChild(); child;
child = child->Tree().NextSibling()) { child = child->Tree().NextSibling()) {
......
...@@ -2121,6 +2121,12 @@ be describing additional metrics about the same event. ...@@ -2121,6 +2121,12 @@ be describing additional metrics about the same event.
First Contentful Paint, in microseconds. First Contentful Paint, in microseconds.
</summary> </summary>
</metric> </metric>
<metric name="UpdateViewportIntersection">
<summary>
Time spent computing internal geometry information about iframes, in
microseconds.
</summary>
</metric>
<metric name="WaitForCommit"> <metric name="WaitForCommit">
<summary> <summary>
The time spent waiting for the compositor thread to begin processing a The time spent waiting for the compositor thread to begin processing a
...@@ -3281,6 +3287,26 @@ be describing additional metrics about the same event. ...@@ -3281,6 +3287,26 @@ be describing additional metrics about the same event.
An int in the range [0,100]. An int in the range [0,100].
</summary> </summary>
</metric> </metric>
<metric name="UpdateViewportIntersection">
<summary>
Time spent computing internal geometry information about iframes, in
microseconds.
</summary>
<aggregation>
<history>
<index fields="profile.country"/>
<statistics>
<quantiles type="std-percentiles"/>
</statistics>
</history>
</aggregation>
</metric>
<metric name="UpdateViewportIntersectionBeginMainFrame">
<summary>
The total main frame time used to compute internal geometry information
about iframes, in microseconds.
</summary>
</metric>
<metric name="WaitForCommit"> <metric name="WaitForCommit">
<summary> <summary>
The time spent waiting for the compositor thread to begin processing a The time spent waiting for the compositor thread to begin processing a
......
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