Lightweight load-testing API and CLI built around FastAPI, k6, and decorator-based target registration.
Project description
LoaderUp
Lightweight load-testing API and CLI built around FastAPI, k6, and decorator-based target registration.
Requirements
- Python
>=3.12 uv(recommended package manager)k6
Install
uv pip install -e .
Run API directly
python -m loader.main
Server starts on http://127.0.0.1:5050 by default.
Run via CLI
python -m loaderup.cli up --app loader.main:app --targets loader.demo_registry_target --reload
This command opens the dashboard automatically at http://127.0.0.1:5050/.
Use --no-open-browser if you want to disable auto-open.
You can also use fallback-friendly forms like:
python -m loaderup.cli up --app main:app --targets demo_registry_targets --reload
Using the decorator with FastAPI
Create your FastAPI app as usual:
# main.py
from fastapi import FastAPI
app = FastAPI()
@app.get("/")
def home():
return {"message": "ok"}
@app.post("/users")
def create_user(payload: dict):
return {"id": 1, **payload}
Then create a module with the load targets you want LoaderUp to test. The decorated functions do not need to call your route handlers; importing this module registers the target metadata.
# targets.py
from loaderup import load_target
@load_target(
name="home page",
method="GET",
path="/",
expected_status=200,
tags=["public"],
)
def home_page():
pass
@load_target(
name="create user",
method="POST",
path="/users",
payload_example={"name": "Ada"},
expected_status=200,
tags=["users"],
)
def create_user():
pass
Start LoaderUp and tell it to import the target module:
python -m loaderup.cli up --app main:app --targets targets --reload
Run all decorator-registered targets against your FastAPI app:
curl -X POST http://127.0.0.1:5050/run/registry \
-H 'Content-Type: application/json' \
-d '{"base_url":"http://127.0.0.1:5050","vus":10,"duration_seconds":30}'
Health check
curl http://127.0.0.1:5050/health
Dashboard
Open:
http://127.0.0.1:5050/
Dashboard includes:
- live status + progress stream
- metrics cards + quick chart bars
- saved run history (persisted in
artifacts/history/runs.jsonl) - React-based multi-tab control center (
Run Now,Live,Registered Targets,History)
Notes
- Registry targets are loaded when the module is imported.
- Use
/run/targetsto submit explicit targets. - Use
/run/registryto run all decorator-registered targets.
Project details
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 loaderup-0.1.4.tar.gz.
File metadata
- Download URL: loaderup-0.1.4.tar.gz
- Upload date:
- Size: 32.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
60dad146a8e4b5bb5c16509f13390c61b137fd53b1114498305012be98730df4
|
|
| MD5 |
45f27d53c67dd8850a77adbccc67aa48
|
|
| BLAKE2b-256 |
192cf9e40cfcca6bf4c9134eeda66b6cd5e2a93864ddd8bc47699b163e3017e9
|
File details
Details for the file loaderup-0.1.4-py3-none-any.whl.
File metadata
- Download URL: loaderup-0.1.4-py3-none-any.whl
- Upload date:
- Size: 36.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
67f44f492a358aa04f6e4e75fc6334c46d7bbc9120eba2daa7f6d603a254d4f9
|
|
| MD5 |
e5e9d5b7df0ae96c325bb5b49da7bf8e
|
|
| BLAKE2b-256 |
4f671e6a282309aa453b2af6cfac17aec01e9b7be2fa1d88dc0160ed97c5e0f1
|