New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 647764 link

Starred by 1 user

Issue metadata

Status: Assigned
Owner:
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug



Sign in to add a comment

Use PageLoadMetricsObserver with web ui pages

Project Member Reported by rdevlin....@chromium.org, Sep 16 2016

Issue description

We need good performance metrics for the chrome://  pages, since we need to be sure not to regress with MD.  Currently, we have a few different metrics, e.g. Settings.LoadDocumentTime.MD (recorded time between DidStartProvisionalLoadForFrame and DocumentLoadedInFrame).  PageLoadMetricsObserver has much fancier metrics (e.g. FirstContentfulPaint), and has handling for a lot more of the corner cases that aren't currently addressed (in page navigations, etc).  It would be great to use that with settings pages to get awesome metrics without needing to add too much architecture.

I'm happy to start with the extensions page for this, and add it to other settings pages when we work out any kinks.
 
Just chatted with bmcquade about this.

For this to work we need a system for allowing observers to set policy on what kinds of pages they want to track (rather than the system making a blanket policy).

This cl (https://codereview.chromium.org/2331053003/) refactors the IPC policy. We'll have to relax this to send non http/https URLs, and add that setting on the per-observer policy settings.

I can draft up a quick design for this.

Comment 2 by dbeam@chromium.org, Sep 16 2016

csharrison@: it'd be great to bring this to user-facing web ui pages.  we have a bunch of one-off ways to do this right now (as rdevlin.cronin@) mentions.  and we're looking into https://github.com/GoogleChrome/lighthouse for /local/ performance metrics, but having remotely logged, "real user" metrics from PageLoadMetricsObserver would be great.
Quick initial design which blocks progress on this:
https://docs.google.com/document/d/17YAXcWk6vnG2654Fbov3hVX9cl34acsjmsjsgG46yEE/edit?usp=sharing

Please take a look. I agree that these pages need metrics love! We are very happy to help out :)
left a few quick comments, but overall this looks good.  I think we'd be thrilled in a world where we can just add a new observer and have it log data for our webui pages. :D
Cc: ksakamoto@chromium.org
+ksakamoto, the extensions page paints most of its contents in an iframe, but FMP is still being triggered experimentally when the topmost frame paints. Is this expected?
Do FMP, FCP, etc have insight into paints in child documents? My impression was that they did not. I agree that for UMA it seems like they probably should. For metrics exposed to web platform, however, they need to be per-document (or at least not leak cross-origin) so we don't leak timing or other information across origins (just something to keep in mind if/when we standardize these).
I double checked the code and it's all document based so this won't work actually. I'm not even sure how "same origin" works for chrome urls. Is chrome://chrome/extensions same origin to chrome://extensions-frame?
We do quite a bit of craziness in the uber page.  To avoid spreading lies, I'll let dbeam@ cover the details.

On the upside, in the material world, things are much more sane.  Top frame is most meaningful, single origin, etc.
Yeah FMP/FCP are computed per-frame, and only main-frame document reports them to PageLoadMetricsObserver.

It would be possible to aggregate per-frame information in browser process and compute "page FMP", but I'm not sure if that will improve accuracy in the real web. In my human evaluation of FMP, I didn't see any case that FMP failed because primary content was in an iframe.

Project Member

Comment 10 by bugdroid1@chromium.org, Sep 28 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b

commit fc9831da34aaf34e58cc1744dd87cc24d43d2f1b
Author: bmcquade <bmcquade@chromium.org>
Date: Tue Sep 27 19:39:08 2016

Update OnCommit to return ObservePolicy.

BUG=647764

Review-Url: https://codereview.chromium.org/2372573005
Cr-Commit-Position: refs/heads/master@{#421299}

[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/core_page_load_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/data_reduction_proxy_metrics_observer_unittest.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/google_captcha_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/google_captcha_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/no_state_prefetch_page_load_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/no_state_prefetch_page_load_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/previews_page_load_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/observers/stale_while_revalidate_metrics_observer.h
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/page_load_metrics_observer.cc
[modify] https://crrev.com/fc9831da34aaf34e58cc1744dd87cc24d43d2f1b/chrome/browser/page_load_metrics/page_load_metrics_observer.h

Project Member

Comment 11 by bugdroid1@chromium.org, Oct 3 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/46595f8ee5878368274f99c9821940897c74b277

commit 46595f8ee5878368274f99c9821940897c74b277
Author: csharrison <csharrison@chromium.org>
Date: Mon Oct 03 22:28:34 2016

Make PageLoadMetricsObserver::OnStart return ObservePolicy

BUG=647764

Review-Url: https://codereview.chromium.org/2386143003
Cr-Commit-Position: refs/heads/master@{#422567}

[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/metrics_web_contents_observer.cc
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/metrics_web_contents_observer_unittest.cc
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.cc
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/observers/from_gws_page_load_metrics_observer.h
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/observers/https_engagement_metrics/https_engagement_page_load_metrics_observer.cc
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/observers/https_engagement_metrics/https_engagement_page_load_metrics_observer.h
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/page_load_metrics_observer.cc
[modify] https://crrev.com/46595f8ee5878368274f99c9821940897c74b277/chrome/browser/page_load_metrics/page_load_metrics_observer.h

Sign in to add a comment