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

The page_vital board source reports CLS and TTFB p75 per route beside LCP and INP #3177

Merged opened this

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

Merged

The `reach` board source now reports `cls_p75` and `ttfb_p75` per route per day, beside the existing LCP and INP rows. `test/boards-query.test.ts` passes (40 tests). I couldn't run the type check: `bun x tsc --noEmit` failed here with "bun is unable to write files to tempdir", and `bun install` failed the same way. The forge's check will run it.

shipped production is serving it deploy d5155e2

opened this

The reach board source now reports cls_p75 and ttfb_p75 per route per day, beside the existing LCP and INP rows. test/boards-query.test.ts passes (40 tests). I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir", and bun install failed the same way. The forge's check will run it.

  • Source: the change is in src/boards/sources.ts, using the same nearest-rank percentile as the other metrics. The metric description now names both and says CLS is a unitless score, not ms.
  • Beacon: unchanged. It already sends cls and ttfb, and page_vital already stores them.
  • Test: the new test seeds vitals for two routes and reads both metrics back by route, then checks that a non-admin gets 403. It deletes its page_vital rows afterwards, because the existing visitor-count test shares the same database.
  • Access: the source stays admin-only, and no visitor hash or user id is listed.
  • Left out: server_p50 and server_p95 still read TTFB too, so ttfb_p75 overlaps them. I kept them for compatibility.

Closes #3167

commented

The reach board source now reports cls_p75 and ttfb_p75 per route per day, beside the existing LCP and INP rows. test/boards-query.test.ts passes (40 tests). I couldn't run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir", and bun install failed the same way. The forge's check will run it.

  • Source: the change is in src/boards/sources.ts, using the same nearest-rank percentile as the other metrics. The metric description now names both and says CLS is a unitless score, not ms.
  • Beacon: unchanged. It already sends cls and ttfb, and page_vital already stores them.
  • Test: the new test seeds vitals for two routes and reads both metrics back by route, then checks that a non-admin gets 403. It deletes its page_vital rows afterwards, because the existing visitor-count test shares the same database.
  • Access: the source stays admin-only, and no visitor hash or user id is listed.
  • Left out: server_p50 and server_p95 still read TTFB too, so ttfb_p75 overlaps them. I kept them for compatibility.
Approved

Approved. cls_p75 and ttfb_p75 reuse the existing nearest-rank percentile, so they inherit the admin-only gate and the route-pattern-only grouping. No new input, output or dependency. The test seeds two routes, checks the nearest-rank result by hand (p75 of 4 values is the 3rd: 0.1 and 30), checks the 403 for a non-admin, and cleans up after itself. Next two: (1) ttfb_p75 now duplicates the server_p50/p95 family. Fold them into one naming scheme (ttfb_p50/p75/p95) once nothing reads the old names. (2) cls_p75 is unitless while every other value is ms, so a board that charts it beside LCP needs its own axis. Put that unit hint where boards render value, not only in the source docs.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs