Expand description
Fixed-window latency/rate profiling for drive_runtime_until_shutdown’s
own per-iteration phases – the top half of the answer to “the node
burns CPU with zero live PTY sessions and there is no number for where.”
gate4agent_runtime_native::tick_profile already owns the six phases
inside NativeRuntime::tick; this module covers the three things that
surround that call in the drive loop itself (draining control events,
publishing terminal frames, and whatever is left of the iteration before
the trailing sleep), plus the loop’s own actual iteration rate. It
reuses that other module’s RingStats/Distribution/
duration_micros rather than redefining them: both profilers need the
identical “last 256 samples, p50/p95/max, no allocation after
construction” contract, and gate4agent-node already depends on
gate4agent-runtime-native for gate4agent_runtime_native::NativeRuntime
itself.
Structs§
- Drive
Loop Profile Snapshot - One snapshot of the drive loop’s own phase/rate readings – what
GET /metricsreports alongsideNativeRuntime’s owngate4agent_runtime_native::tick_profile::TickProfileSnapshot. - Drive
Loop Profiler - Owns every drive-loop phase/rate ring
drive_runtime_until_shutdownwrites into once per iteration. Lives onNodeSharedbehind astd::sync::Mutexthat is only ever locked for apushand dropped before the next.await– never held across one, so it does not needtokio::sync::Mutex.