public interface UiDispatcherTracer
Receives trace events from AndroidUiDispatcher, for tools that record how tasks and frame callbacks are queued and run. Install one with AndroidUiDispatcher.setTracer.
The dispatcher may call instant and counter from any thread, since tasks reach it from arbitrary threads, and calls beginSection and endSection on its own thread. It calls all of them once per dispatched task, so implementations should not be expensive.
Event names, counter names and flow IDs reflect the dispatcher's internal behavior and may change between releases.
Functions
instant
public fun instant(name: String, flowIds: LongList)
Emits an instant event named name, associated with flowIds.
beginSection
public fun beginSection(name: String, flowIds: LongList)
Begins a trace section named name, associated with flowIds. Match this with a corresponding endSection on the same thread.
endSection
public fun endSection()
Ends the trace section that beginSection most recently started on this thread.
counter
public fun counter(name: String, value: Long)
Records value for the counter track named name.
isEnabled
public fun isEnabled(): Boolean
Returns true if tracing is currently active.
The dispatcher calls this before doing any work to build trace arguments, so it should not be expensive.