work work hard work

This commit is contained in:
StellaOps Bot
2025-12-18 00:47:24 +02:00
parent dee252940b
commit b4235c134c
189 changed files with 9627 additions and 3258 deletions

View File

@@ -43,6 +43,32 @@ k6 run --env BASE_URL=http://localhost:5000 \
tests/load/ttfs-load-test.js
```
### Router Rate Limiting Load Test (`router-rate-limiting-load-test.js`)
Exercises Router rate limiting behavior under load (instance/environment limits, mixed routes) and validates `429` + `Retry-After`.
**Scenarios:**
- **below_limit (A)**: sustained load below expected limits
- **above_limit (B)**: ramp above expected limits (expect some `429`)
- **route_mix (C)**: mixed-path traffic to exercise route matching/overrides
- **activation_gate (F)**: low traffic then spike (activation gate exercise)
**Run locally:**
```bash
mkdir results
k6 run --env BASE_URL=http://localhost:5000 \
--env PATH=/api/test \
tests/load/router-rate-limiting-load-test.js
```
**Run with multiple paths (route mix):**
```bash
mkdir results
k6 run --env BASE_URL=http://localhost:5000 \
--env PATHS_JSON='[\"/api/a\",\"/api/b\",\"/api/c\"]' \
tests/load/router-rate-limiting-load-test.js
```
## CI Integration
Load tests can be integrated into CI pipelines. See `.gitea/workflows/load-test.yml` for an example.
@@ -86,3 +112,7 @@ k6 run --out json=results/metrics.json tests/load/ttfs-load-test.js
| `RUN_IDS` | JSON array of run IDs to test | `["run-load-1",...,"run-load-5"]` |
| `TENANT_ID` | Tenant ID header value | `load-test-tenant` |
| `AUTH_TOKEN` | Bearer token for authentication | (none) |
| `METHOD` | HTTP method for router rate limiting test | `GET` |
| `PATH` | Single path for router rate limiting test | `/api/test` |
| `PATHS_JSON` | JSON array of paths for route mix | (none) |
| `RESULTS_DIR` | Output directory for JSON artifacts | `results` |