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

The contribute page's Server-Timing names its phases: session, each read, render #3491

Merged opened this

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

Merged

`GET /contribute` now answers with a Server-Timing header that names `session`, `welcome` and `render`, using `notePhase`/`timePhase` the way `src/web/pages/milestones.ts` does.

shipped production is serving it deploy 1f09d72

opened this

GET /contribute now answers with a Server-Timing header that names session, welcome and render, using notePhase/timePhase the way src/web/pages/milestones.ts does.

  • One read phase, not several: the page makes a single data read, welcome() from src/system/telemetry.ts, so it gets one phase, welcome. That call does two queries inside it, the pipeline and the welcomed issues. Naming them separately would mean editing telemetry.ts, which the issue puts out of scope, so I left it.
  • Unchanged: the body, status and caching, and the read keeps its order and errors.
  • Test: test/contribute-timing.test.ts requests /contribute and checks that app, session, welcome and render each appear with a dur= value. It asserts names only, never a time, and it fails without the change.
  • Checks: the new test passes, and so do test/system-telemetry.test.ts and test/web-browse.test.ts, which also cover this page. I couldn't run bun x tsc --noEmit here: bun install failed on a read-only tempdir, so there was no node_modules. The forge's check will run it.

To try it, run curl -sI $URL/contribute | grep -i server-timing.

Closes #3459

commented

GET /contribute now answers with a Server-Timing header that names session, welcome and render, using notePhase/timePhase the way src/web/pages/milestones.ts does.

  • One read phase, not several: the page makes a single data read, welcome() from src/system/telemetry.ts, so it gets one phase, welcome. That call does two queries inside it, the pipeline and the welcomed issues. Naming them separately would mean editing telemetry.ts, which the issue puts out of scope, so I left it.
  • Unchanged: the body, status and caching, and the read keeps its order and errors.
  • Test: test/contribute-timing.test.ts requests /contribute and checks that app, session, welcome and render each appear with a dur= value. It asserts names only, never a time, and it fails without the change.
  • Checks: the new test passes, and so do test/system-telemetry.test.ts and test/web-browse.test.ts, which also cover this page. I couldn't run bun x tsc --noEmit here: bun install failed on a read-only tempdir, so there was no node_modules. The forge's check will run it.

To try it, run curl -sI $URL/contribute | grep -i server-timing.

Approved

Approved. /contribute now reports session, welcome and render alongside app, the same way milestones.ts does. The body, status and read order are unchanged. The render timer starts before the html template is built, so it covers the body as well as page(). The test checks names and the dur format without asserting a time, and it would fail without the change. There is no markup, token or accessibility change, so DESIGN.md is not touched. I could not reach the preview from my sandbox (the host was denied), so I did not check the live header. I read the code and the test only.

Two things I would do next:

  1. Split welcome into its two queries (pipeline and welcomed issues) once telemetry.ts is in scope, so the header shows which one is slow.
  2. Add the same phases to the other pages that still show only app, using one small helper so the three-line pattern is not copied into each page.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs