Skip to content

@ogygia/devtools · Dock

Session recording

The dock's Record tab measures what using a page does, not only its load. Press Record, click, type and navigate, press Stop, and it lists slow interactions, dead and repeated clicks, failed requests, errors and DOM churn, with the server's side of the same stretch when the profiler is on.

On this page

A page can load fast and still feel slow: a button that takes half a second to react, a click that does nothing, a filter that fires the same request five times. None of that happens during the load, so the Page tab can’t see it.

The Record tab can. Press ● Record, use the page the way a visitor would (click, type, scroll, navigate), then press ■ Stop. The tab lists what happened during that stretch, with each finding pointing at its elements: hover it to light them up, or press show on the page to scroll there.

localhost:5173/shop
ogygia devtools a mock of seven of the dock's ten tabs; the numbers are made up
0 clicks recorded
  • nothing recorded yet

Multi-page sessions

A session survives a full page load: a plain link, a form post or a reload. As a page goes away it saves its part in sessionStorage, and the next page’s dock picks the session up and keeps recording. The report covers every page on one clock, with each page load marked on the timeline, and islands keep the names they had on their own page.

The browser’s CPU sampler can’t be carried across a page load, so the main-thread section and the function names cover only the page you stop on. The heap reading is that page’s too, so heap-growth is the last page’s growth. Everything else covers every page. In-app navigations by the SPA router aren’t page loads, so they don’t interrupt anything.

Server recording

With the profiler turned on (devtools({ profiler: true })), and the server is ticked by default. The server then records over the same stretch as the browser, and the report adds On the server, meanwhile:

  • the requests your actions made, slowest first, each with the server’s own split when it sent one;
  • the server’s hottest code across them, by its own time;
  • the outbound calls the server waited on;
  • the server’s findings.

A slow request also gets profile it on the server, which profiles that exact path (three renders) and shows where its time went. full server report ↗ opens the profiler’s report of the whole stretch.

Untick and the server to record the browser alone. Without the profiler, the box isn’t there. The tab looks for the profiler at /__profiler only, so a profiler moved to another path isn’t found (#2304). In a build, log in to it in the same browser first.

Report

After you stop, the tab shows:

  • The counts: interactions (and how many were slow), long tasks, requests and their bytes, layout shifts nobody caused, DOM changes and errors.
  • Timeline: the session on one clock, in six lanes: input, main thread, requests, islands and navigations, layout shifts, and errors. Page loads are marked on it. Each request bar shows its server part and, inside that, the wait for its upstream calls. Hover anything for what it was.
  • Findings: what went wrong, worst first. “Nothing in this session looks wrong” when that’s the case.
  • Slowest interactions: each with its wait, its handlers and its paint.
  • Main thread in the session: the busy time, by kind of code and function, from the CPU sampler.

The report stays in the tab until the next recording. An island’s card shows its part of it under “in the last session”.

Session findings

CodeRaised when
slow-interactionA click or key press took 100 ms or more to show a result (a warning from 200 ms). It splits the time into waiting, the handlers and painting, and names the function that ran (from the CPU sampler) or the script (from long-animation-frame records). The five slowest are listed.
rage-clickThe same element was clicked 3 or more times within a second: to a visitor, nothing seemed to happen.
dead-clickA click on something that looks clickable (a link, a button, a control, a pointer cursor) changed nothing: no DOM change, no request and no navigation within half a second, or within 3 seconds in its island.
late-feedbackA click’s island changed only after half a second. Show a reaction at once.
long-tasksMain-thread tasks of 50 ms or more ran. It names the function that held the main thread outside the interactions, when the CPU sampler caught one. A warning from 300 ms in all.
unexpected-shiftThe layout moved with no input to cause it, by 0.02 or more in all (a warning from 0.1). It names the island where it started.
failed-requestsRequests answered with a status of 400 or more.
slow-requestsRequests that took a second or more.
repeated-requestsThe same fetch or XHR path went out 3 or more times. Cache the answer, or share one request.
server-timeWith the profiler on: a request whose server render took 200 ms or more (a warning from 500 ms), split into CPU, the wait on outbound calls (naming the slowest) and the network.
islands-wokeIslands that woke during the session, by name.
hydrate-failedAn island failed to hydrate during the session.
hydrate-recoveredAn island threw away its server HTML and rendered again.
hydrate-healedAnother script changed an island’s markup before it woke, and the runtime put the server’s markup back.
hydrate-conflictA web component changed its own children where Svelte’s hydration reads, so the repair removed what it added. Render it with {@html}, put it in a lake, or mark it to be kept.
critical-capThe page’s critical resources (marked fetchpriority="high") took so long that ogygia stopped holding other downloads back for them.
loads-heldogygia held downloads back so the critical resources and the visible islands went first. A note, with the longest wait.
errorsUncaught errors, unhandled rejections and console.error calls. An island’s failed hydration is reported once, as hydrate-failed.
dom-churnAn island, or code outside any island, changed the DOM 300 times or more. Lots of small changes often mean a re-render on every event.
heap-growthThe JS heap grew by 5 MB or more on the page you stopped on, in a browser that reports it. If it keeps growing across the same actions, something is being kept.
slow-navigationAn in-app navigation took half a second or more, and whether it was reconciled in place or swapped whole.

@ogygia/testing’s ogygia.record() records a session the same way inside a test, and returns these findings with the same codes.

Limits

The tab says which measurements this browser can’t take, as the Page tab does: without interaction timing there are no slow interactions, and without the CPU sampler no function names. A recording runs until you press ■ Stop; closing the tab or the browser drops it. Pressing ■ Stop twice is safe.