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

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

Merged opened this

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

Merged

`GET /family` now sends a Server-Timing header with `session`, `family` and `render` phases after `app`. I could not type-check it: `bun x tsc --noEmit` and `bun install` both failed in this sandbox with "unable to write files to tempdir". The new test and the existing `test/family-heartbeat.test.ts` pass (18 tests).

shipped production is serving it deploy 405fa2a

opened this

GET /family now sends a Server-Timing header with session, family and render phases after app. I could not type-check it: bun x tsc --noEmit and bun install both failed in this sandbox with "unable to write files to tempdir". The new test and the existing test/family-heartbeat.test.ts pass (18 tests).

  • What changed: src/web/pages/family.ts times the read with timePhaseAsync and the render with notePhase, the way milestones.ts does. The body, status codes and caching are unchanged. The new test/family-timing.test.ts signs in, requests /family, and asserts each phase name has a dur= value, never a wall-clock time. It fails without the change.
  • One read phase, not several: the page makes a single data read, familyView, and that function does the parent lookup and the children's standings inside it. Naming those separately would mean editing src/spawn/family.ts, which is outside the files you listed, so I left it. Say if you want that split.
  • How to try it: curl -si $URL/family | grep -i server-timing, or run bun test test/family-timing.test.ts.

Closes #3458

commented

GET /family now sends a Server-Timing header with session, family and render phases after app. I could not type-check it: bun x tsc --noEmit and bun install both failed in this sandbox with "unable to write files to tempdir". The new test and the existing test/family-heartbeat.test.ts pass (18 tests).

  • What changed: src/web/pages/family.ts times the read with timePhaseAsync and the render with notePhase, the way milestones.ts does. The body, status codes and caching are unchanged. The new test/family-timing.test.ts signs in, requests /family, and asserts each phase name has a dur= value, never a wall-clock time. It fails without the change.
  • One read phase, not several: the page makes a single data read, familyView, and that function does the parent lookup and the children's standings inside it. Naming those separately would mean editing src/spawn/family.ts, which is outside the files you listed, so I left it. Say if you want that split.
  • How to try it: curl -si $URL/family | grep -i server-timing, or run bun test test/family-timing.test.ts.
Approved

Approved. /family now sends session, family and render phases after app, using the same notePhase/takeSessionTime/timePhaseAsync calls as boards-view, settings and releases. The body, markup and access rules are unchanged, so the design system, security and both-doors lists have nothing to flag. The new test signs in, requests /family and asserts each phase has a dur= value. It would fail without the change. I could not load the preview from my sandbox (the proxy blocked the host), so I judged the served behaviour from the source and the test only.

Two things I would do next:

  1. Split the single family read into the parent lookup and the children standings, so the header shows which one is slow. That means editing src/spawn/family.ts, which this pull rightly left alone.
  2. Make the test header comment cite this pull or issue (#3490) so it points at the right place.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs