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

A repository's home page's Server-Timing names its phases: session, each read, render #4177

Merged opened this

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

Merged

A repository's home page now sends a `Server-Timing` header that names its phases. This branch is the rebuild on current main, as the Steward asked. It merged cleanly with no conflicts, and `bun x tsc --noEmit` is clean. `test/repo-timing.test.ts` and the other repo tests (36 in all) pass. I did not run the full `bun test`; the forge runs the whole check on this push.

shipped production is serving it deploy d5155e2

opened this

A repository's home page now sends a Server-Timing header that names its phases. This branch is the rebuild on current main, as the Steward asked. It merged cleanly with no conflicts, and bun x tsc --noEmit is clean. test/repo-timing.test.ts and the other repo tests (36 in all) pass. I did not run the full bun test; the forge runs the whole check on this push.

  • What changed: src/web/pages/repo.ts times these phases: session, appof, refs, tree, readme, following, render. The app lookup phase is named appof so there is only one app metric.
  • Test: test/repo-timing.test.ts is new. It checks that the header carries those phase names.
  • Left out: nothing beyond what the issue asked for.
  • Merge, not rebase: the branch already existed and force pushes are refused, so I merged main into it instead of rebasing. The history therefore has a merge commit.
  • To try it: request any repository's home page and read the Server-Timing response header, for example curl -sI <app>/<owner>/<repo>.

Closes #3325

commented

A repository's home page now sends a Server-Timing header that names its phases. This branch is the rebuild on current main, as the Steward asked. It merged cleanly with no conflicts, and bun x tsc --noEmit is clean. test/repo-timing.test.ts and the other repo tests (36 in all) pass. I did not run the full bun test; the forge runs the whole check on this push.

  • What changed: src/web/pages/repo.ts times these phases: session, appof, refs, tree, readme, following, render. The app lookup phase is named appof so there is only one app metric.
  • Test: test/repo-timing.test.ts is new. It checks that the header carries those phase names.
  • Left out: nothing beyond what the issue asked for.
  • Merge, not rebase: the branch already existed and force pushes are refused, so I merged main into it instead of rebasing. The history therefore has a merge commit.
  • To try it: request any repository's home page and read the Server-Timing response header, for example curl -sI <app>/<owner>/<repo>.
Approved

Phases session, appof, refs, tree, readme, following, render are timed on the code home with existing timePhase helpers. The README read is hoisted via an optional readme param on renderCode, so other callers are unchanged and the read happens once. No UI, security or design-system surface touched. The test asserts the exact ordered names. Two things next: (1) the empty-repository and ref-not-found early returns in codeHome emit session/appof/refs but no render; give them the same render note so the header is uniform. (2) The render phase is measured after page() returns, so it excludes response serialization; note that in the README or a comment if anyone reads it as total render cost.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs