Getting Started

Write and run your first load test in 60 seconds.

Install

Save this as example.py. The PEP 723 inline-metadata header declares rampa as a dependency, so uv resolves and runs the script in an ephemeral environment:

# /// script
# requires-python = ">=3.14"
# dependencies = [
#   "rampa",
# ]
# ///

import asyncio
import rampa


@rampa.scenario(executor="constant-vus", vus=5, duration="10s")
async def default(worker: rampa.Worker) -> None:
    resp = await worker.http.get("https://httpbin.org/get")
    worker.check(resp, {"status is 200": lambda r: r.status == 200})

Then run it:

$ uv run load_test.py

Verify:

$ rampa doctor

Write a scenario

Create load_test.py:

import asyncio
import rampa


@rampa.scenario(executor="constant-vus", vus=5, duration="10s")
async def default(worker: rampa.Worker) -> None:
    resp = await worker.http.get("https://httpbin.org/get")
    worker.check(resp, {
        "status is 200": lambda r: r.status == 200,
    })

Run it

$ rampa run load_test.py

The console summary shows iteration count, request timing percentiles (p90, p95, p99), check pass/fail rates, and data transfer totals.

Add thresholds

Thresholds enforce performance criteria. A breach produces exit code 1.

config = rampa.Config(
    thresholds={
        "http_req_duration": ["p(95)<500"],
        "http_req_failed": ["rate<0.01"],
    },
)

Save results

$ rampa run load_test.py --out results.json
$ rampa run load_test.py --event-log events.jsonl

Next steps

  • CLI — all CLI flags and commands

  • Executors — choosing the right executor

  • Metrics — built-in and custom metrics

  • pytest Plugin — load tests in your test suite