feat: API Benchmark Suite — autocannon-based performance testing (#30)#44
Open
malsony wants to merge 2 commits into
Open
feat: API Benchmark Suite — autocannon-based performance testing (#30)#44malsony wants to merge 2 commits into
malsony wants to merge 2 commits into
Conversation
- Add benchmarks/run.mjs — full API benchmark runner covering 22 endpoints - Add benchmarks/thresholds.json — p99 latency thresholds per endpoint - Add benchmarks/.env.benchmark — benchmark environment config template - Add npm scripts: benchmark (full), benchmark:smoke (low concurrency) - Add autocannon + jsonwebtoken as devDependencies - Update .gitignore to exclude benchmark results while keeping .gitkeep - Move jsonwebtoken to devDependencies in apps/api Closes SecureBananaLabs#30
autocannon v8 does not expose p95 nor TTFB. Switch to p97_5 percentile and drop the TTFB column entirely instead of faking it.
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.
Summary
Adds a comprehensive API benchmark suite using autocannon.
What's included
benchmarks/run.mjs — Full benchmark runner that:
benchmarks/thresholds.json — P99 latency thresholds (ms) for each endpoint
benchmarks/.env.benchmark — Configurable env vars (base URL, duration, connections, pipelining, JWT secret)
npm scripts:
npm run benchmark— Full benchmark (10s per endpoint, 10 connections)npm run benchmark:smoke— Smoke test (3s per endpoint, 2 connections).gitignore — Excludes benchmark results JSON/MD files, keeps .gitkeep
Dependencies
Closes #30