[Webium] Skip CWV metrics for initial WebUI pages [chromium/src : main]

0 views
Skip to first unread message

Ming-Ying Chung (Gerrit)

unread,
May 14, 2026, 1:07:54 PM (6 days ago) May 14
to Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Shunya Shishido, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
Attention needed from Annie Sullivan, Rakina Zata Amni and Shunya Shishido

Ming-Ying Chung added 6 comments

Patchset-level comments
File-level comment, Patchset 16:
Ming-Ying Chung . resolved

PTAL. This CL is now repurposed to rely on a shared base class `ukm_page_load_metrics_observer_base.{h,cc}`. The diff is better to read by comparing with PS#13, e.g. https://crrev.com/c/7763259/13..15

Let me know if there is any better approach, as the scale of this CL is quite large.

Commit Message
Line 17, Patchset 4:This CL adds an `is_webui_` flag to `UkmPageLoadMetricsObserver` and
conditionally skip recording these Core Web Vitals metrics for WebUI
pages, while still allowing the collection of other performance
metrics.
Shunya Shishido . resolved

Hmm I think this approach is still error prune of mixing these result...

How about creating webui_ukm_page_load_metrics_observer? And UkmPageLoadMetricsObserver should return `STOP_OBSERVING` when the URL is for InitialWebUI.

Ming-Ying Chung

Introduced `UkmPageLoadMetricsObserverBase`.

File chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer.h
Line 384, Patchset 4: bool is_webui_ = false;
Rakina Zata Amni . resolved

Maybe `is_initial_webui_` since this is not for generic WebUI?

Ming-Ying Chung

removed.

File chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer.cc
Line 371, Patchset 4: if (waap::IsForInitialWebUI(navigation_handle->GetURL())) {
Shunya Shishido . resolved

In crrev.com/c/7760566, I see different logic to filter InitialWebUI URL out (`IsWebUISource()` in `chrome/browser/page_load_metrics/page_load_metrics_browsertest.cc`).

Is there any reason why there are different? If no, which one is correct?

cc: @elk...@chromium.org

Eriko Kurimoto

IsWebUISource is filtering WebUI, and IsForInitialWebUI is filtering Initial WebUI (e.g. WebUI toolbar).

In the page_load_metrics_browsertest.cc, the test expectes there is no separate loading process which ensures the metrics count, but if WebUI runs on the background the test would break. For now, Initial WebUI seems to be the only one which runs with simple url used in the test, but semantically filtering WebUI is correct.

But here, IIUC they want to filter InitialWebUI case only, right? Then IsForInitialWebUI looks better.

Ming-Ying Chung

acked.

File chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_base.h
Line 42, Patchset 8:namespace ukm {
namespace builders {
Ming-Ying Chung . resolved

Please fix this WARNING reported by ClangTidy: check: modernize-concat-nested-namespaces

nested namespaces can be concatenated...

check: modernize-concat-nested-namespaces

nested namespaces can be concatenated (https://clang.llvm.org/extra/clang-tidy/checks/modernize/concat-nested-namespaces.html)

(Note: You can add `Skip-Clang-Tidy-Checks: modernize-concat-nested-namespaces` footer to the CL description to skip the check)

(Lint observed on `android-clang-tidy-rel`, but not on `linux-clang-tidy-rel`)

File chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_unittest.cc
Line 448, Patchset 4: // Verify Kept metrics
tester()->test_ukm_recorder().ExpectEntryMetric(
entry, PageLoad::kPaintTiming_NavigationToFirstPaintName, 250);
tester()->test_ukm_recorder().ExpectEntryMetric(
entry, PageLoad::kPaintTiming_NavigationToFirstContentfulPaintName, 300);
Rakina Zata Amni . resolved

This CL seems fine as a first fix, but I wonder if these might also affect some guardrail metrics. But we still want these UKMs for our performance analysis, so we can't just exclude them as well. Maybe eventually it's better to figure out how the UMA dashboard gets the data and if the dashboard can just exclude the initial WebUI data. Can you please add a TODO for that?

Ming-Ying Chung

Now only include some non-CWV metrics for initial webui.

Maybe eventually it's better to figure out how the UMA dashboard gets the data and if the dashboard can just exclude the initial WebUI data. Can you please add a TODO for that.

Filed https://crbug.com/513226340

Open in Gerrit

Related details

Attention is currently required from:
  • Annie Sullivan
  • Rakina Zata Amni
  • Shunya Shishido
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I03d10233a71600e01b257e16b593f19fd88e19f8
Gerrit-Change-Number: 7763259
Gerrit-PatchSet: 17
Gerrit-Owner: Ming-Ying Chung <my...@chromium.org>
Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
Gerrit-Reviewer: Ming-Ying Chung <my...@chromium.org>
Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Eriko Kurimoto <elk...@chromium.org>
Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
Gerrit-Comment-Date: Thu, 14 May 2026 17:07:24 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: Eriko Kurimoto <elk...@chromium.org>
Comment-In-Reply-To: Shunya Shishido <sisid...@chromium.org>
Comment-In-Reply-To: Rakina Zata Amni <rak...@chromium.org>
satisfied_requirement
unsatisfied_requirement
open
diffy

Johannes Henkel (Gerrit)

unread,
May 14, 2026, 6:07:19 PM (5 days ago) May 14
to Ming-Ying Chung, Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Shunya Shishido, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
Attention needed from Annie Sullivan, Ming-Ying Chung, Rakina Zata Amni and Shunya Shishido

Johannes Henkel added 1 comment

Patchset-level comments
File-level comment, Patchset 17 (Latest):
Johannes Henkel . resolved

Hello,

Based on crbug.com/490810407, I’m thinking the original objective was to record UKMs for initial webui URLs, which are always chrome:// URLs. This was achieved by enabling the UkmPageLoadMetricsObserver for these URLs, with the unfortunate side effect of diluting several important UMA histograms, including CLS - see crbug.com/502471507.

So I think the basic question is, which UKMs are actually required for the webui performance work?

And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

The resulting code and tests should be much easier to understand and maintain.

Please let me know what you think.

Open in Gerrit

Related details

Attention is currently required from:
  • Annie Sullivan
  • Ming-Ying Chung
  • Rakina Zata Amni
  • Shunya Shishido
Submit Requirements:
  • requirement satisfiedCode-Coverage
  • requirement is not satisfiedCode-Owners
  • requirement is not satisfiedCode-Review
  • requirement is not satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: comment
Gerrit-Project: chromium/src
Gerrit-Branch: main
Gerrit-Change-Id: I03d10233a71600e01b257e16b593f19fd88e19f8
Gerrit-Change-Number: 7763259
Gerrit-PatchSet: 17
Gerrit-Owner: Ming-Ying Chung <my...@chromium.org>
Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
Gerrit-Reviewer: Ming-Ying Chung <my...@chromium.org>
Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
Gerrit-CC: Eriko Kurimoto <elk...@chromium.org>
Gerrit-CC: Johannes Henkel <joha...@chromium.org>
Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
Gerrit-Attention: Ming-Ying Chung <my...@chromium.org>
Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
Gerrit-Comment-Date: Thu, 14 May 2026 22:07:10 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
satisfied_requirement
unsatisfied_requirement
open
diffy

Ming-Ying Chung (Gerrit)

unread,
May 14, 2026, 11:15:24 PM (5 days ago) May 14
to Johannes Henkel, Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Shunya Shishido, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
Attention needed from Annie Sullivan, Johannes Henkel, Rakina Zata Amni and Shunya Shishido

Ming-Ying Chung added 1 comment

Patchset-level comments
Johannes Henkel . unresolved

Hello,

Based on crbug.com/490810407, I’m thinking the original objective was to record UKMs for initial webui URLs, which are always chrome:// URLs. This was achieved by enabling the UkmPageLoadMetricsObserver for these URLs, with the unfortunate side effect of diluting several important UMA histograms, including CLS - see crbug.com/502471507.

So I think the basic question is, which UKMs are actually required for the webui performance work?

And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

The resulting code and tests should be much easier to understand and maintain.

Please let me know what you think.

Ming-Ying Chung

PTAL.

So I think the basic question is, which UKMs are actually required for the webui performance work?

I have made [this doc](https://docs.google.com/document/d/1ob71IMc-4TkEvAF3RBgziOmkS2CXn5RSHP5xdrD9f-I/edit?resourcekey=0-LXd9Ij064NcCaYkqbjaV2Q&tab=t.wpav6wc8d5wy) that lists all the existing metrics from `UkmPageLoadMetricsObserver` and discuss which ones we need for Initial WebUI.

And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

It's possible, but depending on how many metrics we log, there might be significant code duplication.

Open in Gerrit

Related details

Attention is currently required from:
  • Annie Sullivan
  • Johannes Henkel
  • Rakina Zata Amni
  • Shunya Shishido
    Submit Requirements:
      • requirement satisfiedCode-Coverage
      • requirement is not satisfiedCode-Owners
      • requirement is not satisfiedCode-Review
      • requirement is not satisfiedNo-Unresolved-Comments
      • requirement is not satisfiedReview-Enforcement
      Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
      Gerrit-MessageType: comment
      Gerrit-Project: chromium/src
      Gerrit-Branch: main
      Gerrit-Change-Id: I03d10233a71600e01b257e16b593f19fd88e19f8
      Gerrit-Change-Number: 7763259
      Gerrit-PatchSet: 17
      Gerrit-Owner: Ming-Ying Chung <my...@chromium.org>
      Gerrit-Reviewer: Annie Sullivan <sull...@chromium.org>
      Gerrit-Reviewer: Ming-Ying Chung <my...@chromium.org>
      Gerrit-Reviewer: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-Reviewer: Shunya Shishido <sisid...@chromium.org>
      Gerrit-CC: Code Review Nudger <android-build...@prod.google.com>
      Gerrit-CC: Eriko Kurimoto <elk...@chromium.org>
      Gerrit-CC: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Johannes Henkel <joha...@chromium.org>
      Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
      Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-Comment-Date: Fri, 15 May 2026 03:14:59 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      May 15, 2026, 5:03:29 AM (5 days ago) May 15
      to Ming-Ying Chung, Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Shunya Shishido, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
      Attention needed from Annie Sullivan, Ming-Ying Chung, Rakina Zata Amni and Shunya Shishido

      Johannes Henkel added 3 comments

      Patchset-level comments
      Johannes Henkel . unresolved

      Hello,

      Based on crbug.com/490810407, I’m thinking the original objective was to record UKMs for initial webui URLs, which are always chrome:// URLs. This was achieved by enabling the UkmPageLoadMetricsObserver for these URLs, with the unfortunate side effect of diluting several important UMA histograms, including CLS - see crbug.com/502471507.

      So I think the basic question is, which UKMs are actually required for the webui performance work?

      And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

      The resulting code and tests should be much easier to understand and maintain.

      Please let me know what you think.

      Ming-Ying Chung

      PTAL.

      So I think the basic question is, which UKMs are actually required for the webui performance work?

      I have made [this doc](https://docs.google.com/document/d/1ob71IMc-4TkEvAF3RBgziOmkS2CXn5RSHP5xdrD9f-I/edit?resourcekey=0-LXd9Ij064NcCaYkqbjaV2Q&tab=t.wpav6wc8d5wy) that lists all the existing metrics from `UkmPageLoadMetricsObserver` and discuss which ones we need for Initial WebUI.

      And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

      It's possible, but depending on how many metrics we log, there might be significant code duplication.

      Johannes Henkel

      Thanks so much for making the doc - the detailed table looks great!

      I think I'm noticing, there are metrics in ukm_page_load_metrics_observer_base.cc in this change (e.g. PageLoad.Net_HttpRttEstimate_OnNavigationStart) which are marked as 'skip' in your doc. This may be a good thing, right?

      I think you're right about the code duplication, and there may be runtime cost and also, some maintenance cost when multiple locations need to be updated.

      However, separation has its benefits as well, both for analyses (e.g. one can assume that PageLoad UKM events don't cover chrome:// URLs, like most existing colabs do) but also for maintenance, when making changes to either WebUI related metrics or traditional PageLoad metrics with the confidence that they won't interfere with each other. For instance, if I wanted to quickly log a metric to a UMA histogram that's in the superclass in your change (ukm_page_load_metrics_observer_base.cc), it may end up including the WebUI measurements accidentally. And vice versa, having your independent logging may allow you to move more quickly, in some cases.

      What do you think?
      Also, what are other people's opinions on this?

      File chrome/browser/page_load_metrics/observers/core/ukm_page_load_metrics_observer_browsertest.cc
      Johannes Henkel . unresolved

      Do the updates to this file work without the other part of your change by any chance? Looks sweet!

      Line 35, Patchset 17 (Latest):
      MATCHER_P2(HasMetric, ukm_recorder, metric_name, "") {
      if (!ukm_recorder->GetEntryMetric(arg, metric_name)) {
      *result_listener << "where metric '" << metric_name << "' is missing";
      return false;
      }
      return true;
      }

      MATCHER_P2(LacksMetric, ukm_recorder, metric_name, "") {
      if (ukm_recorder->GetEntryMetric(arg, metric_name)) {
      *result_listener << "where metric '" << metric_name
      << "' is unexpectedly present";
      return false;
      }
      return true;
      }
      Johannes Henkel . unresolved
      Open in Gerrit

      Related details

      Attention is currently required from:
      • Annie Sullivan
      • Ming-Ying Chung
      Gerrit-Attention: Annie Sullivan <sull...@chromium.org>
      Gerrit-Attention: Shunya Shishido <sisid...@chromium.org>
      Gerrit-Attention: Ming-Ying Chung <my...@chromium.org>
      Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-Comment-Date: Fri, 15 May 2026 09:03:16 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      Comment-In-Reply-To: Johannes Henkel <joha...@chromium.org>
      Comment-In-Reply-To: Ming-Ying Chung <my...@chromium.org>
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Shunya Shishido (Gerrit)

      unread,
      May 19, 2026, 4:49:23 AM (22 hours ago) May 19
      to Ming-Ying Chung, Johannes Henkel, Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
      Attention needed from Annie Sullivan, Ming-Ying Chung and Rakina Zata Amni

      Shunya Shishido added 1 comment

      Patchset-level comments
      Johannes Henkel . unresolved

      Hello,

      Based on crbug.com/490810407, I’m thinking the original objective was to record UKMs for initial webui URLs, which are always chrome:// URLs. This was achieved by enabling the UkmPageLoadMetricsObserver for these URLs, with the unfortunate side effect of diluting several important UMA histograms, including CLS - see crbug.com/502471507.

      So I think the basic question is, which UKMs are actually required for the webui performance work?

      And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

      The resulting code and tests should be much easier to understand and maintain.

      Please let me know what you think.

      Ming-Ying Chung

      PTAL.

      So I think the basic question is, which UKMs are actually required for the webui performance work?

      I have made [this doc](https://docs.google.com/document/d/1ob71IMc-4TkEvAF3RBgziOmkS2CXn5RSHP5xdrD9f-I/edit?resourcekey=0-LXd9Ij064NcCaYkqbjaV2Q&tab=t.wpav6wc8d5wy) that lists all the existing metrics from `UkmPageLoadMetricsObserver` and discuss which ones we need for Initial WebUI.

      And, is it possible to make a list of these, and record them separately (e.g. in InitialWebUIPageLoadMetricsObserver) to a new UKM event?

      It's possible, but depending on how many metrics we log, there might be significant code duplication.

      Johannes Henkel

      Thanks so much for making the doc - the detailed table looks great!

      I think I'm noticing, there are metrics in ukm_page_load_metrics_observer_base.cc in this change (e.g. PageLoad.Net_HttpRttEstimate_OnNavigationStart) which are marked as 'skip' in your doc. This may be a good thing, right?

      I think you're right about the code duplication, and there may be runtime cost and also, some maintenance cost when multiple locations need to be updated.

      However, separation has its benefits as well, both for analyses (e.g. one can assume that PageLoad UKM events don't cover chrome:// URLs, like most existing colabs do) but also for maintenance, when making changes to either WebUI related metrics or traditional PageLoad metrics with the confidence that they won't interfere with each other. For instance, if I wanted to quickly log a metric to a UMA histogram that's in the superclass in your change (ukm_page_load_metrics_observer_base.cc), it may end up including the WebUI measurements accidentally. And vice versa, having your independent logging may allow you to move more quickly, in some cases.

      What do you think?
      Also, what are other people's opinions on this?

      Shunya Shishido

      I also feel the current direction still has a risk to mix and pollute existing metrics. IMHO the priority is not to pollute the metrics rather than reducing the code duplication.

      Open in Gerrit

      Related details

      Attention is currently required from:
      • Annie Sullivan
      • Ming-Ying Chung
      • Rakina Zata Amni
      Gerrit-Attention: Ming-Ying Chung <my...@chromium.org>
      Gerrit-Attention: Rakina Zata Amni <rak...@chromium.org>
      Gerrit-Comment-Date: Tue, 19 May 2026 08:48:56 +0000
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy

      Johannes Henkel (Gerrit)

      unread,
      May 19, 2026, 5:00:09 AM (22 hours ago) May 19
      to Ming-Ying Chung, Code Review Nudger, Annie Sullivan, Eriko Kurimoto, Shunya Shishido, Rakina Zata Amni, Chromium LUCI CQ, android-bu...@system.gserviceaccount.com, loading-rev...@chromium.org, csharris...@chromium.org, speed-metr...@chromium.org, core-web-vita...@chromium.org, speed-metrics...@chromium.org, bmcquad...@chromium.org
      Attention needed from Annie Sullivan, Ming-Ying Chung and Rakina Zata Amni

      Johannes Henkel added 1 comment

      Patchset-level comments
      Johannes Henkel . resolved

      Hi again ... I noticed that the page load metrics related integration test framework has also received updates related to logging webui related metrics in PageLoad events - filtering them for the tests, basically.

      https://chromium-review.git.corp.google.com/c/chromium/src/+/7707018/15/chrome/browser/page_load_metrics/integration_tests/metric_integration_test.cc

      This is problematic because:

      1) Querying TestUkmRecorder::GetMergedEntriesByName (e.g.) directly in a new test isn't covered by the filtering, so it will return UkmEntries for PageLoad events that don't have a source recorded. This now happens even for very simple tests, and is difficult to debug: Note that MetricIntegrationTest::IsWebUISource(nullptr) returns true - just now it took me a couple hours to notice that it's due to WebUI (there is really no hint, as there's no URL associated with the PageLoad events, not even chrome://).

      2) It's not clear how webui related recording can be well tested, when the integration test framework filters the relevant events.

      Gerrit-Comment-Date: Tue, 19 May 2026 08:59:58 +0000
      Gerrit-HasComments: Yes
      Gerrit-Has-Labels: No
      satisfied_requirement
      unsatisfied_requirement
      open
      diffy
      Reply all
      Reply to author
      Forward
      0 new messages