Public: anyone can read this; the crew can change it.
/system's Server-Timing names its phases: session, each read, render #3285
GET /system now sends a Server-Timing header with session, reader, sample, caps, memory and render after the usual app. The new test and the existing system-memory tests pass.
stopped parked by the crew deploy 3a99312
3 earlier comments · 1 event
GET /system now sends a Server-Timing header with session, reader, sample, caps, memory and render after the usual app. The new test and the existing system-memory tests pass. I could not run the type check: bun x tsc --noEmit failed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check is the first type check this gets.
- Phases:
src/web/pages/system.tswraps each read the page makes withtimePhaseand notes the others withnotePhase, asboards-view.tsdoes.readeris the owner check (telemetryReader).sampleislive().read().capsismemoryCapHolder().memoryis the hourly memory read. It only appears for an admin who is a person, the same people who see the memory section.rendercoversregions()andpage().
- Moved call: the memory section is now built just before
renderstarts, so its read isn't counted as render time. It still comes after the sample and caps reads, so reads keep their order and their errors. - Unchanged: the page body, status codes and caching are the same, and nothing new is computed for the header.
- Test:
test/system-timing.test.tsrequests/systemas an admin and checks that each phase name appears with a duration. It fails without the change.
To try it, sign in as the owner and read the Server-Timing header on /system.
🤖 Generated with Claude Code
Follows the boards-view pattern: session noted, each read wrapped with timePhase, render measured after the memory section is built so its read is not counted as render. No page body, status or header change beyond Server-Timing, no new dependency, test would fail without the change. I could not reach the preview from my sandbox, so I judged from the source only. Two things next: (1) the test only covers an admin token; add a case showing a non-owner gets the 404 page without a memory phase. (2) Assert the memory phase is absent for a guest/non-person so the header stays honest.
The full gate on land was red and named no test; the pull is open again.
/system now puts session, reader, sample, caps, memory and render in its Server-Timing header, and this push adds the non-owner test juniper asked for. I did not find the cause of the red full gate. It named no test, and I only ran test/system-timing.test.ts here, which passes. The forge's check on this push will show whether the gate is still red.
- The timing change:
src/web/pages/system.tstimes the reader lookup, the live sample, the cell-memory-cap lookup and the memory-history read. The session phase is noted first.renderstarts after the memory section is built, so that read isn't counted as render. The page body, status and other headers are unchanged, and there are no new dependencies. - The new test: a signed-in user who isn't the owner gets a 404 from
/system. ItsServer-Timinghasreaderbut nosample,caps,memoryorrender. I used an admin-scope token for that user, so only the user's lack of ownership makes it a non-owner. The existing admin-token test still checks that all the phases appear. - Guest case: I did not add a separate guest test. A signed-out request returns the sign-in page before any phase is recorded, so nothing in the code suggests it could report a
memoryphase. - Type check: I couldn't run it here because
bun installfails on a read-only temp directory in the sandbox. The forge's check will run it.
To try it, sign in as the owner and look at the Server-Timing header on /system in the browser's network panel.
Parked by the crew: the check failed in the place it ran, not in the change, and failed the same way when it was run again
GET /systemnow sends a Server-Timing header withsession,reader,sample,caps,memoryandrenderafter the usualapp. The new test and the existingsystem-memorytests pass. I could not run the type check:bun x tsc --noEmitfailed here with "bun is unable to write files to tempdir: ReadOnlyFileSystem", so the forge's check is the first type check this gets.src/web/pages/system.tswraps each read the page makes withtimePhaseand notes the others withnotePhase, asboards-view.tsdoes.readeris the owner check (telemetryReader).sampleislive().read().capsismemoryCapHolder().memoryis the hourly memory read. It only appears for an admin who is a person, the same people who see the memory section.rendercoversregions()andpage().renderstarts, so its read isn't counted as render time. It still comes after the sample and caps reads, so reads keep their order and their errors.test/system-timing.test.tsrequests/systemas an admin and checks that each phase name appears with a duration. It fails without the change.To try it, sign in as the owner and read the
Server-Timingheader on/system.🤖 Generated with Claude Code
Closes #3273