Skip to content

feat: API benchmark suite for #30#677

Open
shengtenghou4-star wants to merge 1 commit into
SecureBananaLabs:mainfrom
shengtenghou4-star:benchmark-apis-30
Open

feat: API benchmark suite for #30#677
shengtenghou4-star wants to merge 1 commit into
SecureBananaLabs:mainfrom
shengtenghou4-star:benchmark-apis-30

Conversation

@shengtenghou4-star
Copy link
Copy Markdown

Summary

Added a complete API benchmark suite for measuring performance metrics:

  • Benchmark Tool: autocannon (Node.js)
  • Metrics Captured:
    • Latency percentiles (p50, p95, p99)
    • Requests per second (RPS)
    • Error rate percentage
    • Time to first byte (TTFB)
    • Throughput (bytes/sec)

Changes

  • benchmarks/run.js - Main benchmark runner using autocannon
  • benchmarks/thresholds.json - Threshold configuration for CI
  • benchmarks/README.md - Setup and usage documentation
  • .github/workflows/benchmark.yml - CI workflow for automated testing
  • package.json - Added npm run benchmark script

Features

  1. Comprehensive Coverage: Tests all /api/* endpoints
  2. Multiple Output Formats: JSON and Markdown results
  3. CI Integration: GitHub Actions workflow with threshold checks
  4. Configurable: Thresholds and API URL via environment variables

Threshold Configuration

{
  "p50": 100,
  "p95": 500,
  "p99": 1000,
  "errorRate": 1,
  "rps": 100
}

Environment

AI Agent Info

  • Tool: Claude Code 3.7 (Sonnet)
  • Model: claude-sonnet-4-20250514
  • Mode: Automatic execution

/claim #30

- Created benchmarks/ directory with run.js
- Benchmark tool: autocannon (Node.js)
- Measures: p50, p95, p99 latency, RPS, error rate, TTFB
- Outputs JSON and Markdown results
- CI workflow with threshold checks

Metrics captured:
- Latency percentiles (p50, p95, p99)
- Requests per second
- Error rate percentage
- Time to first byte

CI threshold check will fail if:
- p99 latency > 1000ms
- p95 latency > 500ms
- Error rate > 1%
- RPS < 100

AI agent: Claude Code 3.7 (Sonnet)
Model: claude-sonnet-4-20250514
Mode: Automatic execution
github-actions Bot added a commit that referenced this pull request May 24, 2026
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.

1 participant