MetricFcpEntry

FCP is a key performance metric that measures the time taken for the first-screen rendering of lynx app to complete. It refers to the time taken for users to see any content (such as text or images) on a lynx app for the first time. MetricFcpEntry interface provides timing information about this metric, inheriting from PerformanceEntry.

The FCP event is triggered when Lynx completes the rendering of the first frame of the lynx app. For lynx apps that rely on network requests or asynchronous I/O to fetch data, the typical state monitored at FCP is the loading page or a placeholder, as shown in the diagram below:

Depending on different starting points, Lynx provides three metrics: fcp, lynxFcp, and totalFcp. Each metric's definition in the rendering process is illustrated in the diagram below:

Example

This example demonstrates how to obtain a MetricFcpEntry.

Lynx calculates the FCP upon completion of the first frame rendering. If you have provided container-related timestamps using LynxView.setExtraTiming, the MetricFcpEntry includes fcp, lynxFcp, and totalFcp. Otherwise, the MetricFcpEntry only contains lynxFcp. After supplementing the container timestamp, the remaining metrics will be recalculated. Once recalculation is complete, Lynx will send a new MetricFcpEntry containing all the metrics.

Instance Properties

entryType

entryType: string;

The type of performance event; the value for all instances of this class is fixed as metric.

name

name: string;

The specific name of the performance event; the value for all instances of this class is fixed as fcp.

fcp

fcp?: PerformanceMetric;

The time taken from preparing the TemplateBundle to the completion of the first rendering, with a data type of PerformanceMetric.

Calculation formula: fcp = LoadBundleEntry.paintEnd - InitContainerEntry.prepareTemplateStart.

lynxFcp

lynxFcp: PerformanceMetric;

The time taken from loading the TemplateBundle to the completion of the first rendering, with a data type of PerformanceMetric.

Calculation formula: lynxFcp = LoadBundleEntry.paintEnd - LoadBundleEntry.loadBundleStart.

totalFcp

totalFcp?: PerformanceMetric;

The time taken from the user opening the page to the completion of the first rendering, with a data type of PerformanceMetric.

Calculation formula: totalFcp = LoadBundleEntry.paintEnd - InitContainerEntry.openTime.

Compatibility

LCD tables only load in the browser

Except as otherwise noted, this work is licensed under a Creative Commons Attribution 4.0 International License, and code samples are licensed under the Apache License 2.0.