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

The shelf's stretches show in Server-Timing on /, /apps and a person's page #6264

Merged opened this

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

Merged

`/apps` and `/:owner` now send the shelf's laps in Server-Timing. `/` does not, because its shelf is the cached front page rather than `shelfRows`. I ran `test/shelf-speed.test.ts` and `test/shelf-laps.test.ts` (7 pass); I did not run the full check or the type check.

shipped production is serving it deploy c82665e

opened this

/apps and /:owner now send the shelf's laps in Server-Timing. / does not, because its shelf is the cached front page rather than shelfRows. I ran test/shelf-speed.test.ts and test/shelf-laps.test.ts (7 pass); I did not run the full check or the type check.

The failure that parked this pull was a test I hadn't updated. test/shelf-speed.test.ts ("40 apps are drawn within budget, in the phases Server-Timing names") expected the old bare lap names. I changed it to expect the new shelf- names. The test was wrong, not the code. I also grepped test/ for the old names and found no other test that pins them.

  • Laps: shelfRows already recorded its stretches under bare names such as runs. They are now shelf-records, shelf-runs, shelf-production, shelf-pulls and shelf-rows (the per-row stretch). Hyphens, because notePhase rejects dots, so shelf.runs would throw.
  • Repeated name: /:owner sent owner twice in one header. The org access lookup is now access.
  • / signed out: its one shelf phase is split into shelf (reading the front page) and tiles (drawing them). I updated the "GET / signed out names session, shelf, render…" test to expect tiles. Breaking down the front page's own work would need a request passed into src/actions/front.ts, which I left out.
  • Tests: test/shelf-laps.test.ts requests /apps, /keeper and / with two apps and asserts each lap name appears exactly once.

To try it, run curl -sI <preview>/apps | grep -i server-timing.

Closes #6178

commented

/apps and /:owner now send the shelf's laps in Server-Timing. / does not, because its shelf is the cached front page rather than shelfRows. I ran test/shelf-speed.test.ts and test/shelf-laps.test.ts (7 pass); I did not run the full check or the type check.

The failure that parked this pull was a test I hadn't updated. test/shelf-speed.test.ts ("40 apps are drawn within budget, in the phases Server-Timing names") expected the old bare lap names. I changed it to expect the new shelf- names. The test was wrong, not the code. I also grepped test/ for the old names and found no other test that pins them.

  • Laps: shelfRows already recorded its stretches under bare names such as runs. They are now shelf-records, shelf-runs, shelf-production, shelf-pulls and shelf-rows (the per-row stretch). Hyphens, because notePhase rejects dots, so shelf.runs would throw.
  • Repeated name: /:owner sent owner twice in one header. The org access lookup is now access.
  • / signed out: its one shelf phase is split into shelf (reading the front page) and tiles (drawing them). I updated the "GET / signed out names session, shelf, render…" test to expect tiles. Breaking down the front page's own work would need a request passed into src/actions/front.ts, which I left out.
  • Tests: test/shelf-laps.test.ts requests /apps, /keeper and / with two apps and asserts each lap name appears exactly once.

To try it, run curl -sI <preview>/apps | grep -i server-timing.

Approved

Approved. I checked the preview at this head. /apps sends shelf-records, shelf-runs, shelf-production, shelf-pulls, shelf-rows once each, next to apps, archived, shelf, cost and render. / sends session, shelf, tiles, render, with no name repeated. I could not reach a person's page on the preview because it has no seeded owner, so /:owner is covered only by test/shelf-laps.test.ts (/keeper). The test asserts that each name appears once, so it would fail without the owner → access rename and without the shelf- prefix.

Security: the change only renames timing phases. Phase names are constants, and durations are numbers. No input, write or identity path is touched. There is no markup change in src/web/, so the design system is not affected. There is no terminal surface to mirror.

One gap against #6178, which I opened as #6273 rather than hold this pull. / never calls shelfRows: its shelf is the cached frontPage, so the 70–90 ms that a cache miss spends in buildFrontPage is still a single shelf number. The shelf/tiles split is fine as a first cut. The renaming of the shelf-speed and front-timing tests is justified: they pinned the old names.

Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs