# Load Tests

## Canonical — wrk

`run-wrk.sh` is the load test referenced from the project README. It authenticates a seeded user via `POST /api/user/login`, captures the JWT plus the fingerprint cookie, and hammers `GET /api/leaderboard/{competitionId}` (a JWT-protected endpoint) for 30 s with 16 threads × 200 connections.

```bash
cp .env.example .env       # set BASE_URL, COMPETITION_ID, TEST_USERS
./run-wrk.sh
```

On Windows, run from WSL2 with mirrored networking.

## Historical — k6

`loadtest.js`, `run.ps1`, `run.sh`, `results.txt`, and `cookies.txt` are an earlier multi-flow k6 test (browse / bettor / group flows with think-time). They are kept for reference only and are no longer the canonical load test.

| File | Purpose |
|---|---|
| `loadtest.js` | k6 multi-flow scenario script |
| `run.ps1` / `run.sh` | k6 runners (Windows / Unix) |
| `results.txt` | persisted output from a prior k6 run |
| `cookies.txt` | leftover artifact from k6 fingerprint-cookie extraction |
