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

The fleet graph page's Server-Timing names its phases: session, each read, render #3536

Merged opened this

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

Merged

`GET /fleet/graph` now answers with a Server-Timing header naming `session`, `graph` and `render`, alongside the usual `app`. I couldn't run the type check: `bun x tsc --noEmit` failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". `bun test test/fleet-graph-timing.test.ts test/fleet-graph.test.ts` passes, 21 tests. The forge's check on this push will run the type check.

shipped production is serving it deploy b8ab032

opened this

GET /fleet/graph now answers with a Server-Timing header naming session, graph and render, alongside the usual app. I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". bun test test/fleet-graph-timing.test.ts test/fleet-graph.test.ts passes, 21 tests. The forge's check on this push will run the type check.

  • Change: fleetGraphPage in src/web/pages/fleet-graph.ts uses notePhase and timePhase the way src/web/pages/milestones.ts does. The body, status codes and caching are unchanged.
  • Test: test/fleet-graph-timing.test.ts signs in, requests the page, and asserts each phase name appears with a duration. It checks names only, never a wall-clock time. I didn't run it against the old code to see it fail, but the old page emitted none of these phases.
  • Only one read phase: the page makes one data read, readFleetGraph, so there is one phase for it, graph. Splitting out its inner queries would mean editing src/actions/fleet-graph.ts, which the issue puts out of bounds.
  • Missing on a bad selection: when the selection is refused (422) or the viewer isn't signed in, there is no read, so graph is absent.
  • Not touched: /fleet/graph/live and /fleet/graph.csv, since the issue covers only the page.

Closes #3500

commented

GET /fleet/graph now answers with a Server-Timing header naming session, graph and render, alongside the usual app. I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". bun test test/fleet-graph-timing.test.ts test/fleet-graph.test.ts passes, 21 tests. The forge's check on this push will run the type check.

  • Change: fleetGraphPage in src/web/pages/fleet-graph.ts uses notePhase and timePhase the way src/web/pages/milestones.ts does. The body, status codes and caching are unchanged.
  • Test: test/fleet-graph-timing.test.ts signs in, requests the page, and asserts each phase name appears with a duration. It checks names only, never a wall-clock time. I didn't run it against the old code to see it fail, but the old page emitted none of these phases.
  • Only one read phase: the page makes one data read, readFleetGraph, so there is one phase for it, graph. Splitting out its inner queries would mean editing src/actions/fleet-graph.ts, which the issue puts out of bounds.
  • Missing on a bad selection: when the selection is refused (422) or the viewer isn't signed in, there is no read, so graph is absent.
  • Not touched: /fleet/graph/live and /fleet/graph.csv, since the issue covers only the page.
Approved

Approved. The page now names session, graph and render beside app, using the same notePhase/timePhase pattern as milestones.ts. The body, status codes and caching are unchanged, and no markup or CSS moved, so docs/DESIGN.md is untouched. The test would fail without the change, and it checks names only, not wall-clock times. I could not reach the preview from my sandbox (the host is blocked), so I judged from the source and the test. Next: (1) add the same phases to /fleet/graph/live and /fleet/graph.csv, since the redraw is the hot path once the page is open. (2) Make the 422 and signed-out paths assert that graph is absent, so the contract is pinned.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs