Skip to content

feat: add API benchmark suite - #81

Open
thefuturrjfhejh wants to merge 2 commits into
SecureBananaLabs:mainfrom
thefuturrjfhejh:codex/benchmark-suite-30
Open

thefuturrjfhejh wants to merge 2 commits into
SecureBananaLabs:mainfrom
thefuturrjfhejh:codex/benchmark-suite-30

Conversation

@thefuturrjfhejh

@thefuturrjfhejh thefuturrjfhejh commented May 17, 2026 •

Copy link
Copy Markdown

/claim #30

What changed

  • Added an autocannon-based benchmark suite under benchmarks/.
  • Covers every current /api/* route on main: auth, users, jobs, proposals, payments, reviews, messages, notifications, uploads, search, and admin metrics.
  • Supports local ephemeral API benchmarking by default, or an external target through BENCHMARK_BASE_URL.
  • Adds .env.benchmark.example, route inventory, threshold config, JSON + Markdown result output, and root scripts:
    • npm run benchmark
    • npm run benchmark:smoke
  • Adds focused API test coverage for route inventory and benchmark threshold config.
  • Adds a non-production benchmark header skip for the global rate limiter so local benchmark traffic measures endpoint behavior instead of immediately turning into 429s.

Demo

Validation

  • npm run test -w apps/api - 3 pass / 0 fail
  • npm run benchmark:smoke - all 20 routes pass thresholds
  • BENCHMARK_DURATION_SECONDS=3 BENCHMARK_CONNECTIONS=4 npm run benchmark - wrote benchmarks/results/latest.json and benchmarks/results/latest.md
  • node --check benchmarks/run.mjs
  • git diff --check
  • ffmpeg -v error -i benchmarks/results/demo.mp4 -f null -

Latest benchmark summary

The committed benchmarks/results/latest.md contains the full table. The slowest p99 in the latest local run was POST /api/auth/login at 32ms; all routes had 0 error rate and 0 non-2xx rate.

Note

I could not add a GitHub Actions workflow from this token because GitHub rejected workflow-file pushes without workflow OAuth scope. The smoke gate is implemented as npm run benchmark:smoke and can be wired into CI by maintainers with workflow permissions.

@thefuturrjfhejh
thefuturrjfhejh force-pushed the codex/benchmark-suite-30 branch from aaff0ad to 5710d35 Compare May 17, 2026 15:24
@thefuturrjfhejh

Copy link
Copy Markdown
Author

Added the missing short demo artifact in benchmarks/results/demo.mp4 and pushed it to the PR branch. Verified the file decodes with ffmpeg -v error -i benchmarks/results/demo.mp4 -f null -. Workflow file is still blocked by OAuth workflow scope, so the CI gate remains available as npm run benchmark:smoke for maintainers to wire in.

@thefuturrjfhejh

Copy link
Copy Markdown
Author

Adding the clickable demo link explicitly so it is not hidden as only a file path: https://github.com/thefuturrjfhejh/bug-bounty/blob/codex/benchmark-suite-30/benchmarks/results/demo.mp4

@BossChaos

Copy link
Copy Markdown

Code Review

PR: feat: add API benchmark suite by @thefuturrjfhejh

  • ✅ Performance benchmark suite

Wallet: 0xdaE5d307339074A24F579dB48e7c639359D94904

Code review for SecureBananaLabs bug-bounty

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.

2 participants