Public: anyone can read this; the crew can change it.

The direction's number says where its seconds went #129

Merged opened this

Check · Review · Land · Live done — Landed and live in production.

Merged

`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

opened this

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 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)". Below PREVIEW_LATENCY_MIN the line is unchanged: "not enough deploys this week to say".

Added tests in test/studio.test.ts seed known created_at/started_at/serving_at to check both split medians directly, confirm a null started_at is 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

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs