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

The telemetry settings page's Server-Timing names its phases: session, each read, render #3530

Merged opened this

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

Merged

`GET /settings/telemetry` now sends a Server-Timing header naming `session`, `agents`, `reads` and `render`, alongside the usual `app`. I couldn't run the type check: `bun x tsc --noEmit` fails here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". `bun test` on the new test and on `test/system-telemetry.test.ts` passes (12 tests).

shipped production is serving it deploy b2c98db

opened this

GET /settings/telemetry now sends a Server-Timing header naming session, agents, reads and render, alongside the usual app. I couldn't run the type check: bun x tsc --noEmit fails here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". bun test on the new test and on test/system-telemetry.test.ts passes (12 tests).

  • Change: in src/web/pages/telemetry.ts I used notePhase, takeSessionTime and timePhase the way milestones.ts does. agents times grantable and reads times recentReads, in the same order as before. render covers building the body and the usage shell. Nothing extra is computed for the header.
  • Unchanged: the page body, status codes and caching are untouched. A denied or signed-out request returns the same response as before, but it carries only the session phase.
  • Test: test/telemetry-timing.test.ts signs in as the owner and requests the page. It checks the "Telemetry grants" heading, then that app, session, agents, reads and render each carry a dur= value. It asserts names only, never a wall-clock time. I didn't run it without the change to see it fail, but the agents and reads checks have nothing to match without it.
  • Left out: the POST handler and every other page.

To try it, sign in as the owner and run curl -si -b <cookie> $URL/settings/telemetry | grep -i server-timing.

Closes #3497

commented

GET /settings/telemetry now sends a Server-Timing header naming session, agents, reads and render, alongside the usual app. I couldn't run the type check: bun x tsc --noEmit fails here with "bun is unable to write files to tempdir: ReadOnlyFileSystem". bun test on the new test and on test/system-telemetry.test.ts passes (12 tests).

  • Change: in src/web/pages/telemetry.ts I used notePhase, takeSessionTime and timePhase the way milestones.ts does. agents times grantable and reads times recentReads, in the same order as before. render covers building the body and the usage shell. Nothing extra is computed for the header.
  • Unchanged: the page body, status codes and caching are untouched. A denied or signed-out request returns the same response as before, but it carries only the session phase.
  • Test: test/telemetry-timing.test.ts signs in as the owner and requests the page. It checks the "Telemetry grants" heading, then that app, session, agents, reads and render each carry a dur= value. It asserts names only, never a wall-clock time. I didn't run it without the change to see it fail, but the agents and reads checks have nothing to match without it.
  • Left out: the POST handler and every other page.

To try it, sign in as the owner and run curl -si -b <cookie> $URL/settings/telemetry | grep -i server-timing.

Approved

Approved. The telemetry page now reports session, agents, reads and render in Server-Timing, using the same notePhase, takeSessionTime and timePhase helpers as settings, boards and releases. The page body, the owner gate and the escaping are unchanged. The denied path returns before any query and carries only the session phase. The new test signs in as the owner and checks that all five names carry a dur value. It asserts names only, so it will not flake on wall-clock time. It would fail without the change, because agents, reads and render would be missing. I read the diff and the sibling pages; I did not run the tests or fetch the preview.

Two things I would do next:

  1. Time the POST /settings/telemetry grant write the same way, so a slow toggle shows up in the header too.
  2. Move the new route_timing import up with the other ../../core imports, so the import block stays in order.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs