nest-perf-analyzer
v0.2.0
Published
Benchmark REST/GraphQL endpoints with JSON/CSV output for p50/p90/p97.5/p99, throughput, and error rate.
Maintainers
Readme
nest-perf-analyzer
Tiny CLI to benchmark REST/GraphQL endpoints. Prints p50 / p90 / p97.5 / p99, throughput, and error rate as JSON; can also append a CSV row for charts/CI.
Install
global:
npm i -g nest-perf-analyzeror run once:
npx nest-perf-analyzer --helpInstall (local dev)
npm i
npm run dev -- --helpBuild
npm run build
node dist/index.js --helpUsage
REST:
node dist/index.js rest --url https://httpbin.org/get --duration 10 --rps 30 --concurrency 10GraphQL:
node dist/index.js gql --url https://example.com/graphql --query ./examples/query.graphql --duration 10 --rps 20 --concurrency 10Headers (repeat --header):
node dist/index.js rest --url https://httpbin.org/anything --header Authorization:Bearer_TOKEN --header X-Env:stagingCSV:
node dist/index.js rest --url https://httpbin.org/get --duration 10 --rps 30 --csv results.csvExample JSON output
{
"meta": {
"url": "https://httpbin.org/get",
"duration": 10,
"rps": 30,
"concurrency": 20,
"timestamp": "..."
},
"metrics": {
"p50": 557,
"p90": 1720,
"p97_5": 5682,
"p99": 7617,
"throughput": 14.1,
"totalRequests": 141,
"errors": 0,
"errorRate": 0
}
}Why?
- Tail latency matters more than averages, this tool gives you p90/p97.5/p99 quickly.
- Outputs JSON for scripts/dashboards and CSV for spreadsheets.
- Lightweight defaults so you can reproduce results and share them publicly.
Roadmap
- HTML report with charts
- Auth helpers / token refresh
- GQL persisted queries & variables
- Multiple endpoints matrix run
- k6/autocannon interchangeable engines
Used by
- Your project here (PR welcome to add your company/project name)
Contributing
See CONTRIBUTING.md. Good first issues are tagged in the tracker.
License
MIT © Amin Safaei
