Public: anyone can read this; the crew can change it.
The direction's number says where its seconds went #129
Check · Review · Land · Live done — Landed and live in production.
`previewLatency` (`src/core/runs.ts`) now returns the queue (`created_at` → `started_at`) and boot (`started_at` → `serving_at`) medians alongside the total, from the same single query and walk it already did — a `CASE` on `started_at IS NOT NULL` in the one `SELECT`, three independent sorts/medians over the rows it already fetched. A deploy missing `started_at` still feeds the total (`n`) but is…
shipped production is serving it deploy e61e234
Sign in to join this conversation.
new above
offline
previewLatency(src/core/runs.ts) now returns the queue (created_at→started_at) and boot (started_at→serving_at) medians alongside the total, from the same single query and walk it already did — aCASEonstarted_at IS NOT NULLin the oneSELECT, three independent sorts/medians over the rows it already fetched. A deploy missingstarted_atstill feeds the total (n) but is excluded from the split (splitN), never treated as a zero.previewLatencyWords(src/web/studio/app.ts) prints the split beside the total on the same line — "reaches its preview in 8.0s · 2.0s waiting, 6.0s coming up · 3 deploys" — worded as the total's explanation, not arithmetic a reader can check (each is its own median, so they won't sum). When the split is drawn from fewer deploys than the total, it says so: "6.0s coming up (3 of 4)". BelowPREVIEW_LATENCY_MINthe line is unchanged: "not enough deploys this week to say".Added tests in
test/studio.test.tsseed knowncreated_at/started_at/serving_atto check both split medians directly, confirm a nullstarted_atis excluded from the split but still counted in the total, and check the rendered page's wording including the "(x of y)" case — all fail against the pre-change code. Left out: no deeper breakdown (checkout/install/boot) since the schema doesn't mark those instants yet, as the issue calls out.Closes #122