Skip to main content
hitspec includes built-in stress testing. Add --stress to your run command and your functional tests become load tests — no separate tool required.

Quick Start

Two Modes

Rate Mode

Controls throughput by setting a target number of requests per second:

Virtual Users (VU) Mode

Simulates concurrent users, each making sequential requests with optional think time between them:

Ramp-Up

Gradually increase load instead of starting at full capacity:
This linearly increases the request rate from 0 to 200 over the first 30 seconds, then holds at 200 for the remaining duration.

Thresholds

Set pass/fail criteria for CI/CD pipelines. If any threshold is exceeded, the command exits with a non-zero code:
Available threshold metrics: You can also assert on percentile latencies in your expect blocks:

Stress Testing Flags

Per-Request Annotations

Control how individual requests behave during stress tests:

Available Annotations

Setup and Teardown

Use @stress.setup and @stress.teardown for one-time operations:

Stress Profiles

Define reusable stress configurations in hitspec.yaml:
Run a profile:

Managing Profiles from studio

The hitspec studio stress screen lets you create, edit, and delete profiles without touching hitspec.yaml directly. Changes are persisted to hitspec.yaml automatically.

Results Panel

After a stress test completes (either naturally or via stop), studio displays a results view with:
  • Summary cards — Total requests, average RPS, success rate, and error count
  • Latency percentiles — Min, P50, P95, P99, Max, Mean, and Standard Deviation (all in fractional milliseconds)
  • Per-request breakdown — A table showing each request’s count, success/error split, and individual latency metrics (avg, min, max, P50, P95, P99)
  • Threshold indicators — Pass/fail badges for each configured threshold
Click Run Again to return to the configuration view and start another test. The results are also available programmatically via the GET /api/v1/stress/result endpoint.

Testing Directories and Multiple Files

Stress testing works with directories and multiple files:

Understanding Rate Limits

Your server may have its own rate limits. High failure rates often indicate you are exceeding them.
Start with a low rate and increase gradually. If you see high failure rates (above 10%), reduce --rate and --max-vus. Exactly N successes in 60 seconds often reveals a server-side rate limit of N req/min.

CI/CD Integration

Use stress testing in GitHub Actions with thresholds:

Metrics Export

Export stress test metrics to monitoring systems:
See the CI/CD integration guide for more details.
Last modified on July 13, 2026