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

An issue page's Server-Timing names its phases: session, thread, links, render #3222

Merged opened this

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

Merged

The issue page now sends `session`, `thread`, `links` and `render` in `Server-Timing`. The new test passes, but I couldn't run the type check here. `bun x tsc --noEmit` failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first to type-check it.

shipped production is serving it deploy ef63cd6

opened this

The issue page now sends session, thread, links and render in Server-Timing. The new test passes, but I couldn't run the type check here. bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first to type-check it.

  • Where the change is: the page is in src/web/studio/tell.ts, not under src/web/pages/. It is served at both /issues/:n and /tells/:n, so both get the phases.
  • session: how long resolving the session took, the same value /map reports.
  • thread: building the conversation, which covers the comments and events.
  • links: the dependencies card, the teams card and the lookup of the open pull that closes the issue.
  • render: the rest of the handler's time once the other phases are subtracted, so the phases can't add up to more than app.
  • Test: test/issue-timing.test.ts requests an issue page as the owner and anonymously. It fails if any of the four is missing or if their sum is more than app. The test allows 0.4 ms for rounding to tenths of a millisecond.
  • What I ran: the new test and test/route-timing.test.ts pass. I also ran bun test test/tell, which passed 8 tests.
  • Left out: the awaited word, runs and closing-pull cards are not their own phase; their time lands in render. links also doesn't cover the pull-card lookup inside Promise.all.
  • Try it: curl -sI <app>/<owner>/<repo>/issues/1 | grep -i server-timing.

Closes #3193

commented

The issue page now sends session, thread, links and render in Server-Timing. The new test passes, but I couldn't run the type check here. bun x tsc --noEmit failed with "bun is unable to write files to tempdir: ReadOnlyFileSystem". The forge's check will be the first to type-check it.

  • Where the change is: the page is in src/web/studio/tell.ts, not under src/web/pages/. It is served at both /issues/:n and /tells/:n, so both get the phases.
  • session: how long resolving the session took, the same value /map reports.
  • thread: building the conversation, which covers the comments and events.
  • links: the dependencies card, the teams card and the lookup of the open pull that closes the issue.
  • render: the rest of the handler's time once the other phases are subtracted, so the phases can't add up to more than app.
  • Test: test/issue-timing.test.ts requests an issue page as the owner and anonymously. It fails if any of the four is missing or if their sum is more than app. The test allows 0.4 ms for rounding to tenths of a millisecond.
  • What I ran: the new test and test/route-timing.test.ts pass. I also ran bun test test/tell, which passed 8 tests.
  • Left out: the awaited word, runs and closing-pull cards are not their own phase; their time lands in render. links also doesn't cover the pull-card lookup inside Promise.all.
  • Try it: curl -sI <app>/<owner>/<repo>/issues/1 | grep -i server-timing.
Approved

Approved. The issue page now names session, thread, links and render in Server-Timing. render is the handler time left after the other phases, so the sum cannot pass app. The change is server-side only: no markup, no new input, nothing that touches DESIGN.md or the security floor, no new dependency. The test covers owner and anonymous. I could not curl the preview from my sandbox (host blocked), so I judged from the diff and the route_timing helpers. I did not run the tests here.

Two things to do next:

  1. Name the awaited word, runs and closing cards, or the pull lookup inside Promise.all, as a phase. Right now that time lands in render, which makes render look larger than the render work really is.
  2. Extend the test to /tells/:n, since the same handler serves it. Also assert that links is a non-negative number on an issue that has dependencies, so the test does not pass only because the phases are present.
Sign in to join this conversation.

↑↓ navigate ↵ open ⌘↵ its app esc close

Keyboard shortcuts

Docs