Load testing framework
Project description
rampa
A Python 3.14+ async load testing framework with headless engine, typed metrics, threshold policies, and six executor types matching k6's scheduling models.
Pre-alpha. APIs may change.
Installation
$ uv add rampa
Quick Start
Write a test script:
import rampa
@rampa.scenario(executor="constant-vus", vus=10, duration="30s")
async def default(worker: rampa.Worker) -> None:
resp = await worker.http.get("https://test.k6.io")
worker.check(resp, {
"status is 200": lambda r: r.status == 200,
})
Run it:
$ rampa run load_test.py
Full Example
import rampa
from rampa import Config, Scenario
config = Config(
scenarios={
"load": rampa.ScenarioConfig(
executor="ramping-arrival-rate",
rate=10.0,
stages=[
rampa.Stage(duration="1m", target=100),
],
pre_allocated_vus=50,
max_vus=200,
),
},
thresholds={
"http_req_duration": ["p(95)<500"],
"http_req_failed": ["rate<0.01"],
},
)
async def setup() -> dict:
return {"base_url": "https://staging.example.com"}
@rampa.scenario("load")
async def load_test(worker: rampa.Worker) -> None:
resp = await worker.http.get(
f"{worker.setup_data['base_url']}/api/users"
)
worker.check(resp, {
"status is 200": lambda r: r.status == 200,
"body has users": lambda r: len(r.json()["users"]) > 0,
})
Headless Engine API
For programmatic use (pytest, TUI, MCP, CI):
import asyncio
import rampa
plan = rampa.loader.load_test("load_test.py")
controller = await rampa.Engine(plan).start()
# Poll metrics while running
snapshot = controller.snapshot()
# Or consume events
async for event in controller.events():
print(event)
result = await controller.wait()
print(result.status) # RunStatus.PASSED / THRESHOLD_FAILED / ...
CLI
$ rampa run script.py --vus 10 --duration 30s --out result.json
Exit codes: 0 = passed, 1 = threshold failed, 2 = iteration error, 3 = invalid config, 4 = aborted, 5 = setup failure.
Executors
| Executor | Model | Description |
|---|---|---|
constant-vus |
Closed | Fixed N workers for a duration |
ramping-vus |
Closed | Linear VU ramp between stages |
shared-iterations |
Closed | N VUs share M total iterations |
per-vu-iterations |
Closed | Each VU runs exactly N iterations |
constant-arrival-rate |
Open | Timer-based scheduling, dropped iterations |
ramping-arrival-rate |
Open | Rate interpolation between stages |
Links
- Source: https://github.com/tony/rampa
- Issues: https://github.com/tony/rampa/issues
- Docs: https://rampa.git-pull.com/
- Changelog: CHANGES
- License: MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file rampa-0.0.1a0.tar.gz.
File metadata
- Download URL: rampa-0.0.1a0.tar.gz
- Upload date:
- Size: 210.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
999de6222ee598b187b794307108a36e653efe2a82fddcf8f47004157e6bc479
|
|
| MD5 |
a7eadbb3a84a9accf10a875460f660cf
|
|
| BLAKE2b-256 |
aafaacd03dccec6c2e372693e46049ba699d8cca40c1fdf4b0d5eb8b669cd8fb
|
Provenance
The following attestation bundles were made for rampa-0.0.1a0.tar.gz:
Publisher:
tests.yml on tony/rampa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rampa-0.0.1a0.tar.gz -
Subject digest:
999de6222ee598b187b794307108a36e653efe2a82fddcf8f47004157e6bc479 - Sigstore transparency entry: 1627260108
- Sigstore integration time:
-
Permalink:
tony/rampa@914e0316715edcaf75dbefa1f97764bc992f13a0 -
Branch / Tag:
refs/tags/v0.0.1a0 - Owner: https://github.com/tony
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@914e0316715edcaf75dbefa1f97764bc992f13a0 -
Trigger Event:
push
-
Statement type:
File details
Details for the file rampa-0.0.1a0-py3-none-any.whl.
File metadata
- Download URL: rampa-0.0.1a0-py3-none-any.whl
- Upload date:
- Size: 51.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
930e55ab8b3f2892b727ff769de8586e87ddee25140df1c851793c7569a059d0
|
|
| MD5 |
a7969eb179f8d8170dc131b9543ea7c8
|
|
| BLAKE2b-256 |
760124d59fb9b4782ccfd0d4d30a2fccaf75ce2b6484ceff66b6d3d069b996be
|
Provenance
The following attestation bundles were made for rampa-0.0.1a0-py3-none-any.whl:
Publisher:
tests.yml on tony/rampa
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
rampa-0.0.1a0-py3-none-any.whl -
Subject digest:
930e55ab8b3f2892b727ff769de8586e87ddee25140df1c851793c7569a059d0 - Sigstore transparency entry: 1627260174
- Sigstore integration time:
-
Permalink:
tony/rampa@914e0316715edcaf75dbefa1f97764bc992f13a0 -
Branch / Tag:
refs/tags/v0.0.1a0 - Owner: https://github.com/tony
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
tests.yml@914e0316715edcaf75dbefa1f97764bc992f13a0 -
Trigger Event:
push
-
Statement type: