Padmanav's picture
test(load): add Locust load test suite for /analyze and /analyze/async endpoints
4466add
|
Raw
History Blame Contribute Delete
718 Bytes

A newer version of the Gradio SDK is available: 6.20.0

Upgrade

Load Testing

Uses Locust to simulate burst traffic against the API.

Run locally

pip install locust
locust -f tests/load/locustfile.py \
  --host=http://localhost:8000 \
  --users=20 \
  --spawn-rate=2 \
  --run-time=60s \
  --headless

Environment variables

Variable Default Description
API_KEY test-key API key sent in X-API-Key header
LOAD_TEST_REPO https://github.com/psf/requests Repo submitted for analysis

Expected behaviour under load

  • /analyze/async should handle 20 req/min per key before returning 429
  • /api/v1/health p99 should stay under 50ms
  • Worker queue depth should stabilise, not grow unboundedly