Main-thread stalls by route (#9016)

The forge counts every wake of its event loop more than 200 ms late as a stall, and charges it in full to each route pattern whose request ran across it (none when no request did) — the same reading as the event loop blocked log lines (src/perf/loop.ts), so a fix's before and after reads from the forge itself, not the pod log.

A request still running when the wake comes (#11478) is charged too, when it began at or before the stall did: its row is <route> (in flight), apart from the same route's finished requests, in every place below (MCP system stalls as { cause, ms, count } with cause that name). The open set is src/perf/in_flight.ts: one map entry per request being answered, added and removed in O(1), read only at a stall.

Where to look (a forge admin who is a person; anyone else gets 404, or no palette entry):

Comparing with #8978

#8978 measured /api/v1/telemetry/flow holding the thread 69.6 s in 6 minutes (2026-11-02, 0.7.349): about 11.6 s a minute, or roughly 700,000 ms an hour at that rate. The /api/v1/telemetry/flow row on /system is that figure for the last hour; for the same 6-minute window, increase(forge_loop_stall_milliseconds_total{route="/api/v1/telemetry/flow"}[6m]) in Prometheus, compared with 69,600.

Caveats: a stall over two requests counts against both, so routes sum past the wall time; a request held open across many stalls (a slow upload, say) is charged with each; a restart starts the figures at zero.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs