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

A board's Server-Timing names its phases: session, board, grid, render #3252

opened this

Merged 46d 5h ago, live in production

GET /boards/:slug now reports four phases in Server-Timing: session, board, grid and render. The new test and test/boards-page.test.ts pass (28 tests), and tsc --noEmit is clean. I didn't run the full suite; the forge runs the whole check on this push.

Notes

opened this

GET /boards/:slug now reports four phases in Server-Timing: session, board, grid and render. The new test and test/boards-page.test.ts pass (28 tests), and tsc --noEmit is clean. I didn't run the full suite; the forge runs the whole check on this push.

  • session: comes from takeSessionTime.
  • board: wraps the showBoard read.
  • grid: times the call to grid(). It builds its HTML eagerly, so the timing covers the real work, not just a declaration.
  • render: times page(...) and is recorded just before the response is returned.

src/web/pages/boards-view.ts is the only source file changed. grid is now built before page(...) runs, and the body is otherwise identical. A missing board still returns the 404 page, now after the session and board phases are recorded.

test/board-timing.test.ts makes a board with one panel and GETs it. It expects each of the four names exactly once, each with a numeric dur. A second test checks that an unknown slug gives 404. The first test fails without the change because those names are absent from the header.

I did not touch /boards/:slug/live or the boards list; the issue names only boardShow.

Setup note: bun install and tsc only worked here with BUN_TMPDIR pointed at $TMPDIR.

🤖 Generated with Claude Code

Closes #3250

commented

GET /boards/:slug now reports four phases in Server-Timing: session, board, grid and render. The new test and test/boards-page.test.ts pass (28 tests), and tsc --noEmit is clean. I didn't run the full suite; the forge runs the whole check on this push.

  • session: comes from takeSessionTime.
  • board: wraps the showBoard read.
  • grid: times the call to grid(). It builds its HTML eagerly, so the timing covers the real work, not just a declaration.
  • render: times page(...) and is recorded just before the response is returned.

src/web/pages/boards-view.ts is the only source file changed. grid is now built before page(...) runs, and the body is otherwise identical. A missing board still returns the 404 page, now after the session and board phases are recorded.

test/board-timing.test.ts makes a board with one panel and GETs it. It expects each of the four names exactly once, each with a numeric dur. A second test checks that an unknown slug gives 404. The first test fails without the change because those names are absent from the header.

I did not touch /boards/:slug/live or the boards list; the issue names only boardShow.

Setup note: bun install and tsc only worked here with BUN_TMPDIR pointed at $TMPDIR.

🤖 Generated with Claude Code

Sign in to join this conversation.

Search
↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs