Repository navigation
feat: live results while a run is in progress - #19
Merged
Merged
Conversation
The agent writes live.json (perfkit/live/v1) every 15 s and serves it read-only with CORS for the project's site and localhost, tunnelled with @ngrok/ngrok when NGROK_AUTHTOKEN is set. The latest page polls it and draws the live view; perfkit serve previews a site locally.
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While a run is in progress, the benchmarks page shows it live. Live is on for every run.
What changes
perfkit/live/v1). Zod schema plusschemas/live-v1.schema.json. The agent writes<run root>/live.jsonevery 15 s (temp file, then rename): run id, version, commit, status (running,finished,failedwithreason), project, estimated end, and every benchmark in perfkit.yaml order with its state (queued,running,done,not-run).heldCps, and once doneresult(limit, lower bound, stop reason).growthMBPerHour, which staysnulluntil there is a full hour of data after the warm-up.evaluateCapacityStepnow returns the step's numbers, and the soak's least-squares growth is moved intomemoryGrowthMBPerHour, which the verdict also calls.GET /live.jsonfrom a node:http server on127.0.0.1:<live.port>(default 8787,--live-port):Cache-Control: no-store;project.siteUrlandhttp://localhost:*, plus thengrok-skip-browser-warningheader, and the server answers the OPTIONS preflight;NGROK_AUTHTOKEN, an@ngrok/ngroktunnel opens onlive.domainorNGROK_DOMAIN. The server and tunnel close when the run ends.--local, therun/collectprocess serves it from this machine.project.live.urlorlive.urlin perfkit.yaml, or let it default tohttps://<live.domain>/live.json. The URL goes into report.jsonproject.live.url, an additive optional field.?live=<url>on the page overrides it.data/runs.jsonlists the run. Run pages never go live.prefers-reduced-motion. The final report is unchanged: live CSS and chart options are added only when live.perfkit serve --site <dir> [--port 8080]. A static server for local previews. The README has the local recipe.run.yamltakes an optionalNGROK_AUTHTOKENsecret and passes it only to the start job, which puts it into the agent container's environment.Verified
npm test(626 passing),npm run typecheck,npm run lint.perfkit run --local: a 3-step ramp, then a 3-minute soak with a 1-minute warm-up, watched withperfkit serveand headless Chromium. The page went live, updated, showed "Run finished; the report is being published", then drew the final report once it was rendered into the site.Notes for review
@ngrok/ngroknative binding for the agent's Alpine container is installed on the load generator at start (npm installof the pinned 1.7.0 innode:22-alpine), only when a token is set. It never fails the run.🤖 Generated with Claude Code