perfTimelineReader top-level property

List<Map<String, Object?>> Function() perfTimelineReader
getter/setter pair

Reader for the host-side timeline rows ext.dusk.perf_trace exports beside dusk's own interactions and frames: HTTP requests, queries, magic notifies, counters, anything with a time on it.

One row per map:

{kind: 'span'|'instant'|'counter', track: String, name: String,
 startUs: int, endUs: int?, id: String?, interactionId: String?,
 linkedBy: String?, value: num?, args: Map?}
  • Times are FlutterTimeline.now microseconds, the clock dusk stamps interactions and the session window with.
  • kind: 'span' with an id becomes an async b/e pair keyed by that id, the shape for work that overlaps other work on its track (two HTTP requests in flight). Without an id it becomes an X slice, which must nest on its track; dusk moves one that would not to an overflow lane (<track> (2)) rather than emit a trace Perfetto draws wrongly. A span with no endUs is still running and ends at the session's end.
  • kind: 'instant' becomes an i event, kind: 'counter' a C event carrying value.
  • interactionId names the PerfInteraction the row belongs to and linkedBy how that was established: 'zone' when the work read the interaction off its own zone, 'frame' when it ran in the frame zone and was joined through activeInteraction() by time.

Return the whole buffer: dusk keeps only rows starting inside the session window. A row missing kind, track, name or an int startUs, a kind outside the three above, or a counter without a numeric value is skipped and counted in the trace's otherData.skippedRows, never a failed export.

Defaults to no rows, so a host without the perf integration wired still gets a trace of dusk's interactions and frames.

Contract: set-once-per-isolate from MagicPerfIntegration.install(). Reset to this default by MagicPerfIntegration.resetForTesting().

Implementation

List<Map<String, Object?>> Function() perfTimelineReader =
    () => <Map<String, Object?>>[];