feat: API benchmark suite for #30#677
Open
shengtenghou4-star wants to merge 1 commit into
Open
Conversation
- 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
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
Added a complete API benchmark suite for measuring performance metrics:
Changes
benchmarks/run.js- Main benchmark runner using autocannonbenchmarks/thresholds.json- Threshold configuration for CIbenchmarks/README.md- Setup and usage documentation.github/workflows/benchmark.yml- CI workflow for automated testingpackage.json- Addednpm run benchmarkscriptFeatures
/api/*endpointsThreshold Configuration
{ "p50": 100, "p95": 500, "p99": 1000, "errorRate": 1, "rps": 100 }Environment
API_URL- Target API base URL (default: http://localhost:3000/api)BENCHMARK_TOKEN- Auth token for protected endpointsAI Agent Info
/claim #30