A callback function that handles performance events, defined as type PerformanceCallback = (entry: PerformanceEntry) => void. The entry is a subclass of PerformanceEntry.
This callback is triggered when the PerformanceObserver receives a performance event.
// Start a trace event with only a namelynx.performance.profileStart('DataFetch');// Start a trace event with custom argumentslynx.performance.profileStart('DataFetch', { args: { url: 'https://api.example.com/data', method: 'GET' },});// Start a trace event with a flow idconst flowId = lynx.performance.profileFlowId();lynx.performance.profileStart('UserAction', { flowId });// Start a duration event with both arguments and flow IDlynx.performance.profileStart('ComplexProcess', { args: { step: 'start' }, flowId,});
// Mark an instant event with only a namelynx.performance.profileMark('FetchStarted');// Mark an instant event with custom argumentslynx.performance.profileMark('FetchStarted', { args: { status: 'initiated' },});// Mark an instant event with a flow idconst flowId = lynx.performance.profileFlowId();lynx.performance.profileMark('ActionCheckpoint', { flowId });// Mark an instant event with both arguments and flow idlynx.performance.profileMark('ProcessMidpoint', { args: { step: 'middle' }, flowId,});
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.