> For AI agents: the complete documentation index is available at /next/llms.txt, the full documentation bundle is available at /next/llms-full.txt.

# PipelineEntry

APISummary
`PipelineEntry` is responsible for recording performance data at key moments during the [Lynx Pipeline](/next/guide/spec.md#lynx-pipeline), specifically for [Framework Rendering](/next/guide/spec.md#framework-rendering) and [Pixel Pipeline](/next/guide/spec.md#pixel-pipeline). It inherits from [`PerformanceEntry`](/next/api/lynx-api/performance-api/performance-entry.md).

The Lynx Pipeline refers to the complete process from the trigger of rendering to the final display. This process is divided into four main parts: Load, Parse, Framework Rendering (FrameworkPipeline), and Engine Rendering (PixelPipeline).

Due to the frequent triggering of the Lynx Pipeline, the framework only records the following two cases:

1. **Lynx Pipeline marked with [`__lynx_timing_flag`](/next/guide/performance/monitor-performance/timing-flag.md)**, which generate performance data as `PipelineEntry`.
2. **Lynx Pipeline triggered by loading and executing a [TemplateBundle](/next/api/lynx-native-api/template-bundle.md)**, which generate performance data as [`LoadBundleEntry`](/next/api/lynx-api/performance-api/performance-entry/load-bundle-entry.md).

The following is the flowchart for `PipelineEntry`:

![](https://lf-lynx.tiktok-cdns.com/obj/lynx-artifacts-oss-sg/plugin/static/pipeline-entry-3-7-compressed.png)
## Example

This example demonstrates how to generate and retrieve `PipelineEntry`.

**This is an example below: performance-api**

**Entry:** `src/pipeline-entry`
**Bundle:** `dist/pipeline-entry.lynx.bundle`

```tsx {11-21,34}
import { root, useEffect, useState } from "@lynx-js/react";
import type { PerformanceEntry, PipelineEntry } from "@lynx-js/types";
import { ScrollItem } from "../common/scroll-item/index.jsx";
import "./index.scss";

export default function PipelineEntryExample() {
  const [pipelineEntry, setPipelineEntry] = useState("");
  const [myName, setMyName] = useState<string | undefined>(undefined);

  useEffect(() => {
    "background-only";
    // 1. Create a performance observer.
    const observer = lynx.performance.createObserver((entry: PerformanceEntry) => {
      if (entry.entryType == "pipeline") {
        // 3. Received "pipeline" event of "myPipeline".
        const pipelineEntry = entry as PipelineEntry;
        // `PerformanceEntry.identifier` is equal to `view.__lynx_timing_flag`.
        if (pipelineEntry.identifier == "myNamePipeline") {
          setPipelineEntry(JSON.stringify(pipelineEntry, null, 4));
        }
      }
    });
    // 2. Register to listen to the "pipeline" event.
    observer.observe(["pipeline"]);

    // Update real data after simulating a network request.
    setTimeout(() => {
      setMyName("PipelineEntry");
    }, 2000);
  }, []);

  return (
    <view className="container">
      <text className="title" __lynx_timing_flag={myName ? "myNamePipeline" : ""}>Hello {myName}~</text>
      <ScrollItem title="PipelineEntry" value={pipelineEntry} />
    </view>
  );
}

root.render(<PipelineEntryExample />);

if (import.meta.webpackHot) {
  import.meta.webpackHot.accept();
}

```

v0.8.0



## Instance properties

### [entryType](/next/api/lynx-api/performance-api/performance-entry.md#entrytype)

```ts
entryType: string;
```

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

### [name](/next/api/lynx-api/performance-api/performance-entry.md#name)

```ts
name: string;
```

The specific name of the performance event; used to distinguish the source of the Pipeline trigger. Possible values include:

- `loadBundle`
- `reloadBundleFromNative`
- `reloadBundleFromBts`
- `updateTriggeredByBts`
- `updateTriggeredByNative`
- `updateGlobalProps`
- `setNativeProps`

### identifier

```ts
identifier: string;
```

A marker for a particular Lynx Pipeline. It can have the following two values:

1. For Lynx Pipelines marked with `__lynx_timing_flag`, **`identifier` equals the value of `__lynx_timing_flag`**.
2. For Lynx Pipelines triggered by loading and executing a `TemplateBundle`, **`identifier` is an empty string**.

### pipelineStart

```ts
pipelineStart: number;
```

The timestamp for the start of the rendering pipeline. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### pipelineEnd

```ts
pipelineEnd: number;
```

The timestamp for the end of the rendering pipeline. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### mtsRenderStart

```ts
mtsRenderStart: number;
```

The timestamp for the start of executing the [main thread scripts](/next/guide/spec.md#main-thread-script-or-mts) to build the Element Tree. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### mtsRenderEnd

```ts
mtsRenderEnd: number;
```

The timestamp for the end of executing the [main thread scripts](/next/guide/spec.md#main-thread-script-or-mts) to build the Element Tree. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### resolveStart

```ts
resolveStart: number;
```

The timestamp for the start of calculating [Element](/next/guide/spec.md#element) styles. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### resolveEnd

```ts
resolveEnd: number;
```

The timestamp for the end of calculating [Element](/next/guide/spec.md#element) styles. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### layoutStart

```ts
layoutStart: number;
```

The timestamp for the start of [layout](/next/guide/spec.md#layout) calculations. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### layoutEnd

```ts
layoutEnd: number;
```

The timestamp for the end of [layout](/next/guide/spec.md#layout) calculations. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### paintingUiOperationExecuteStart

```ts
paintingUiOperationExecuteStart: number;
```

The timestamp for the start of executing [UI operations](/next/guide/spec.md#ui-op) related to painting. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### paintingUiOperationExecuteEnd

```ts
paintingUiOperationExecuteEnd: number;
```

The timestamp for the end of executing [UI operations](/next/guide/spec.md#ui-op) related to painting. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### layoutUiOperationExecuteStart

```ts
layoutUiOperationExecuteStart: number;
```

The timestamp for the start of executing [UI operations](/next/guide/spec.md#ui-op) related to layout. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### layoutUiOperationExecuteEnd

```ts
layoutUiOperationExecuteEnd: number;
```

The timestamp for the end of executing [UI operations](/next/guide/spec.md#ui-op) related to layout. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### paintEnd

```ts
paintEnd: number;
```

The timestamp for the end of completing the final pixelation based on UI and UITree. This timestamp is represented as a floating-point Unix timestamp (in milliseconds) with three decimal places. For example: 1739594612307.429.

### frameworkPipelineTiming

```ts
frameworkPipelineTiming: FrameworkPipelineTiming[keyof FrameworkPipelineTiming];
```

Performance data for key stages in [Framework Rendering](/next/guide/spec.md#framework-rendering). The type is [`FrameworkPipelineTiming`](/next/api/lynx-api/performance-api/framework-pipeline-timing.md).

### hostPlatformTiming

```ts
hostPlatformTiming: AndroidHostPlatformTiming |
  HarmonyHostPlatformTiming |
  IOSHostPlatformTiming;
```

Performance data for platform-specific key stages in [Lynx Pipeline](/next/guide/spec.md#lynx-pipeline), with type [`AndroidHostPlatformTiming`](/next/api/lynx-api/performance-api/host-platform-timing/android-host-platform-timing.md) | [`HarmonyHostPlatformTiming`](/next/api/lynx-api/performance-api/host-platform-timing/harmony-host-platform-timing.md) | [`IOSHostPlatformTiming`](/next/api/lynx-api/performance-api/host-platform-timing/ios-host-platform-timing.md).

### actualFmp

```ts
actualFmp?: PerformanceMetric;
```

The time taken from preparing a [TemplateBundle](/next/api/lynx-native-api/template-bundle.md) to the completion of rendering elements and tags with `__lynx_timing_flag="__lynx_timing_actual_fmp"`. The data type is [`PerformanceMetric`](/next/api/lynx-api/performance-api/performance-metric.md).

Calculation formula: `actualFmp = PipelineEntry.paintEnd - InitContainerEntry.prepareTemplateStart`.

### lynxActualFmp

```ts
lynxActualFmp?: PerformanceMetric;
```

The time taken from loading a [TemplateBundle](/next/api/lynx-native-api/template-bundle.md) to the completion of rendering elements and tags with `__lynx_timing_flag="__lynx_timing_actual_fmp"`. The data type is [`PerformanceMetric`](/next/api/lynx-api/performance-api/performance-metric.md).

Calculation formula: `lynxActualFmp = PipelineEntry.paintEnd - LoadBundleEntry.loadBundleStart`.

### totalActualFmp

```ts
totalActualFmp?: PerformanceMetric;
```

The time taken from the user opening the page to the completion of rendering elements and tags with `__lynx_timing_flag="__lynx_timing_actual_fmp"`. The data type is [`PerformanceMetric`](/next/api/lynx-api/performance-api/performance-metric.md).

Calculation formula: `totalActualFmp = PipelineEntry.paintEnd - InitContainerEntry.openTime`.

## Compatibility

**Compatibility Table**

**Query:** `lynx-api.performance-api.performance-entry.pipeline-entry`

[Source](https://github.com/lynx-family/lynx-website/tree/main/packages/lynx-compat-data/lynx-api/performance-api/performance-entry/pipeline-entry.json)

| Feature | Android | HarmonyOS | iOS | macOS | Windows | Web |
| --- | --- | --- | --- | --- | --- | --- |
| pipeline-entry | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| entryType | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| name | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| identifier | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| pipelineStart | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| pipelineEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| mtsRenderStart | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| mtsRenderEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| resolveStart | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| resolveEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| layoutStart | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| paintingUiOperationExecuteEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| layoutUiOperationExecuteStart | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| layoutUiOperationExecuteEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| paintEnd | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| frameworkPipelineTiming | Yes (3.1) | Yes (3.4) | Yes (3.1) | Yes (3.7) | Yes (3.7) | No |
| hostPlatformTiming | Yes (3.4) | Unknown | Yes (3.4) | Yes (3.7) | Yes (3.7) | No |
| actualFmp | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | No |
| lynxActualFmp | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | No |
| totalActualFmp | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | Yes (3.7) | No |

