Async events are used to specify asynchronous operations. e.g. frames in a game, or network I/O. Async events are specified with the b, n and e event types.

Hierarchy

Properties

args?: Record<string, unknown>

Any arguments provided for the event. Some of the event types have required argument fields, otherwise, you can put any information you wish in here. The arguments are displayed in Trace Viewer when you view an event in the analysis section.

cat?: string

The event categories. This is a comma separated list of categories for the event. The categories can be used to hide events in the Trace Viewer UI.

cname?: string

A fixed color name to associate with the event. If provided, cname must be one of the names listed in trace-viewer's base color scheme's [reserved color names list]https://github.com/catapult-project/catapult/blob/main/tracing/tracing/base/color_scheme.html.

id?: number

An additional required parameter id. We consider the events with the same cat and #id as events from the same event tree. A nested async event should have the same category and id as its parent.

See

id2?: AsyncID2

An alternative required parameter id2. Can be used instead of the default #id field and explicitly specify if it is process-local or global.

name?: string

The name of the event, as displayed in Trace Viewer

ph: "b"

The event type. This is a single character which changes depending on the type of event being output.

pid: number

The process ID for the process that output this event.

scope?: string

An optional scope string can be specified to avoid #id conflicts, in which case we consider events with the same {@Link Event#cat}, #scope, and #id as events from the same event tree.

tid: number

The thread ID for the thread that output this event.

ts: number

The tracing clock timestamp of the event. The timestamps are provided at microsecond granularity.

tts?: number

Optional. The thread clock timestamp of the event. The timestamps are provided at microsecond granularity.