Buffer swap timestamps were previously recorded but not used for either web perf API or internal TBM, UMA, and UKM-based metrics for first paint, first contentful paint, and first meaningful paint. This CL uses the swap timestamps consistently for all first paint metrics, which includes first paint (FP), first contentful paint (FCP), first meaningful paint (FMP), first image paint (FIP), and first text paint (FTP).
This CL also adds 3 new UMAs to evaluate the transition: 1) PageLoad.Internal.Renderer.PaintTiming.SwapResult. The buffer swap is not guaranteed to occur, and our current approach is to use the timestamp regardless of swap failure. However, in the future this may change for certain failure reasons (commit aborts). This metric records how often the swap occurs and why it fails. 2) PageLoad.Internal.Renderer.PaintTiming.SwapTimeDelta. This metric records the differnce between the old, renderer-based timestamp and the new swap-based timestamp. 3) PageLoad.Internal.Renderer.FirstMeaningfulPaintDetector.NetworkQuietBeforeSwapPromiseReported. This records how often the network 2-quiet timer fired before an FMP swap timestamp was reported. In cases where this happens, FMP would have already been reported to PaintTiming with a swap time of 0.
NOTE: This change may cause regressions in telemetry perf tests for page loads. The swap timestamps occur *after* the renderer-based timestamps they are replacing, so any tests using FP, FCP, FMP, FTP, or FIP may appear to have regressed.
Bug: 738235 Cq-Include-Trybots: master.tryserver.chromium.linux:linux_layout_tests_slimming_paint_v2 Change-Id: Ie8c7c72b59b8a26c73d0cd34f3ead95a166a9959 Reviewed-on: https://chromium-review.googlesource.com/576371 Commit-Queue: Scott Haseley
c3f876b Use swap time for all first paint times in TBM, UMA, UKM & web perf API
content/renderer/gpu/render_widget_compositor.cc | 26 +++-
content/renderer/gpu/render_widget_compositor.h | 3 +-
.../core/paint/FirstMeaningfulPaintDetector.cpp | 43 ++++---
.../core/paint/FirstMeaningfulPaintDetector.h | 3 +-
.../paint/FirstMeaningfulPaintDetectorTest.cpp | 122 +++++++++---------
third_party/WebKit/Source/core/paint/PaintEvent.h | 4 +-
.../WebKit/Source/core/paint/PaintTiming.cpp | 142 ++++++++++++++++-----
third_party/WebKit/Source/core/paint/PaintTiming.h | 124 +++++++++++++-----
.../WebKit/public/platform/WebLayerTreeView.h | 18 ++-
tools/metrics/histograms/enums.xml | 13 ++
tools/metrics/histograms/histograms.xml | 31 +++++
11 files changed, 383 insertions(+), 146 deletions(-)