Approach 1: Simple capacity floor
Use--fail-under N to exit non-zero if the run survives fewer than N concurrent users. This is the fastest way to add a load gate — one extra step in your pipeline, no baseline file required.
Approach 2: Baseline comparison
Commit a baseline result JSON from yourmain branch and compare every PR against it. This catches regressions — a PR that ships new code that drops capacity from 150 users to 80 users — without requiring you to pick a magic number upfront.
Below is a complete GitHub Actions workflow that handles both sides:
compare diffs the latest saved run (written automatically to .prescale/runs/) against the baseline JSON. The --fail-on-regression flag makes the step exit non-zero only when the regression check determines capacity has genuinely dropped.
Understanding regression results
compare uses PreScale’s confidence bands to decide whether a regression is real. Every run produces a survives_low–survives_high range alongside the survives_users point estimate. The comparison checks whether the bands overlap:
- Overlapping bands — the difference is within statistical noise. The build passes even if the point estimates differ.
- Non-overlapping bands — the capacity drop is outside noise.
--fail-on-regressiontriggers and the build fails.
--repeat 3 to pool multiple ramp-ups before saving the baseline.
The --markdown flag
prescale compare --markdown produces a PR-comment-ready block: a short summary table and a verdict sentence, formatted in GitHub-flavoured Markdown. Pipe it to a file and hand it to gh pr comment --body-file as shown in the workflow above.