Skip to content

feat: add reproducible API benchmark suite (closes #30)#433

Closed
lluisbernabeu wants to merge 1 commit into
SecureBananaLabs:mainfrom
lluisbernabeu:benchmark-30
Closed

feat: add reproducible API benchmark suite (closes #30)#433
lluisbernabeu wants to merge 1 commit into
SecureBananaLabs:mainfrom
lluisbernabeu:benchmark-30

Conversation

@lluisbernabeu
Copy link
Copy Markdown

/claim #30

Summary

Adds a dependency-light API benchmark runner under /benchmarks/ using autocannon.

Scope

  • Covers every mounted /api/* route plus /health with realistic JSON/form payloads
  • Auth-protected routes benchmarked with configurable test token support

Metrics Per Endpoint

  • p50, p95, p99 latency (ms)
  • Requests per second (peak and sustained)
  • Error rate (%)
  • Throughput (bytes/s)

Output

  • Results written to /benchmarks/results/ as JSON and human-readable markdown
  • Threshold configuration in /benchmarks/thresholds.json
  • Single command: npm run benchmark
  • .env.benchmark template for host/tuning configuration

Contributor Disclosure

Benchmark Environment (Planned)

Hardware

  • CPU: TBD (CI runner or staging host)
  • RAM: TBD
  • Storage: TBD

Software

  • Node.js v20+
  • Express.js 4.19
  • autocannon v7

Methodology

  • Warm-up: 2 seconds
  • Duration: 10 seconds per endpoint
  • Connections: 10 concurrent
  • Pipeling: 1

Closes #30

- Creates /benchmarks/benchmark.js using autocannon
- Covers all /api/* routes plus /health
- Measures p50/p95/p99 latency, req/s, error rate, TTFB
- Outputs results as JSON + markdown summary
- Adds thresholds config in /benchmarks/thresholds.json
- Adds .env.benchmark template for target configuration
- Adds npm run benchmark command
- Adds autocannon as dev dependency
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Benchmark APIs with p50, p95, p99 latency, RPS, error rate and TTFB

2 participants