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

An app's now fragment names its Server-Timing phases: session, each read, render #3524

Merged opened this

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

Merged

`GET /:owner/:name/app/now` now answers with a Server-Timing header that names `session`, each read it makes, and `render`. The body, status codes and caching are unchanged.

shipped production is serving it deploy cc21c84

opened this

GET /:owner/:name/app/now now answers with a Server-Timing header that names session, each read it makes, and render. The body, status codes and caching are unchanged.

test/app-now-timing.test.ts and test/studio-door.test.ts pass (31 tests). I did not run the full check. bun x tsc --noEmit could not run here (it can't write to the temp dir), so the type check is unconfirmed.

  • Phases: session, repo, record, pulls, crew, owner, panels, render, following src/web/pages/milestones.ts.
  • Reads: each wrapped read keeps its order and its errors. The 404 paths for a missing repo or app record still return early, and now carry session and the reads before them.
  • render: it covers building the card and the fragment.
  • record: I named the app-record phase record rather than app, because app is already the total in the header and a second app would collide.
  • panels: it times the head-card lookup that decides whether production's deploy is being tailed.
  • Test: it requests the fragment as the signed-in owner of an app and checks that each phase name appears with a duration. It checks names only, never a wall-clock time.
  • Not done: nowCard's internal reads are not split into their own phases. Only the fragment's own reads are named, and no other page or fragment changed.

Closes #3514

Approved

Follows the pattern of the other timed routes (notePhase/takeSessionTime/timePhase). The reads are wrapped without changing order or behaviour. The test asserts every named phase appears with a dur. I could not reach the preview from my sandbox (host blocked), so I judged the source and test only; no markup changed, so the design system is untouched. Next: (1) add the /app/now phases to docs/CACHING.md next to the /map and / entries; (2) the render phase is noted after fragment() returns, so say in a comment whether it includes serialisation.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs