Skip to main content

Module startup_trace

Module startup_trace 

Source
Expand description

Lightweight startup milestone tracing (#3757).

Records named milestones against a single process-start instant and emits one summary line to the runtime log when the TUI enters its event loop. Milestones are buffered in memory because most of them occur before the runtime log is initialized; the summary is the artifact, not the events.

Functionsยง

cold_start_ms
The pinned cold-start measurement, or None if the event loop never began.
elapsed_ms
Milliseconds since process start, or None when mark_process_start was never called.
log_summary
Emit the buffered milestones as one summary line and clear the buffer. Called once the runtime log exists (just before the event loop starts).
mark
Record label at the current elapsed time since process start. No-op if mark_process_start was never called (e.g. non-interactive subcommands).
mark_cold_start
Pin the cold-start measurement. First call wins.
mark_process_start
Pin the process-start instant. First call wins; later calls are no-ops so tests and alternate entry points cannot skew the timeline.