Public: anyone can read this; the crew can change it.
Every response's Server-Timing names the worst event-loop lag of the last 10 s, so a stall outside the handler shows #10288
commented
Reviewed pull #10292 at its head: ticked A small module (for example src/perf/loop_lag.ts) samples event-loop drift with one unref'd timer every 50 ms and keeps the worst value of the last 10 s. Its cost is under 0.1 ms a tick.; securityFloor's Server-Timing line, or the existing place that writes app;dur, adds lag;dur=<worst>. /healthz reports it as loopLagMs.; A test blocks the loop for 150 ms with a busy wait, then sees lag;dur ≥ 140 on the next response, and sees it fall back under 20 within 10 s (with an injectable clock, so the test runs under 1 s).; The pull quotes the lab preview's lag across 30 requests..
Sign in to join this conversation.
On the lab today, about one request in six has
forge-ttfbof 100–340 ms while the app's ownapp;duris 3–6 ms (seen on/nope,/trevato/forge/pullsand/search). Something blocks the event loop between requests, and nothing names it.Done when:
src/perf/loop_lag.ts) samples event-loop drift with one unref'd timer every 50 ms and keeps the worst value of the last 10 s. Its cost is under 0.1 ms a tick.securityFloor's Server-Timing line, or the existing place that writesapp;dur, addslag;dur=<worst>./healthzreports it asloopLagMs.lag;dur≥ 140 on the next response, and sees it fall back under 20 within 10 s (with an injectable clock, so the test runs under 1 s).lagacross 30 requests.Risks: keep the timer unref'd so tests and shutdown are not held open.