1-- Copyright 2023 The Chromium Authors 2-- Use of this source code is governed by a BSD-style license that can be 3-- found in the LICENSE file. 4 5-- This file specifies common metrics/tables for critical user interactions. It 6-- is expected to be in flux as metrics are added across different CUI types. 7-- Currently we only track Chrome page loads and their associated metrics. 8 9INCLUDE PERFETTO MODULE chrome.page_loads; 10 11-- All critical user interaction events, including type and table with 12-- associated metrics. 13CREATE PERFETTO TABLE chrome_interactions( 14 -- Identifier of the interaction; this is not guaranteed to be unique to the table - 15 -- rather, it is unique within an individual interaction type. Combine with type to get 16 -- a unique identifier in this table. 17 scoped_id INT, 18 -- Type of this interaction, which together with scoped_id uniquely identifies this 19 -- interaction. Also corresponds to a SQL table name containing more details specific 20 -- to this type of interaction. 21 type STRING, 22 -- Interaction name - e.g. 'PageLoad', 'Tap', etc. Interactions will have unique metrics 23 -- stored in other tables. 24 name STRING, 25 -- Timestamp of the CUI event. 26 ts INT, 27 -- Duration of the CUI event. 28 dur INT 29) AS 30SELECT 31 id AS scoped_id, 32 'chrome_page_loads' AS type, 33 'PageLoad' AS name, 34 navigation_start_ts AS ts, 35 IFNULL(lcp, fcp) AS dur 36FROM chrome_page_loads; 37