mirror of
https://github.com/Sea-Haven-Industries/shoc-backend.git
synced 2026-09-30 13:03:12 +00:00
41 lines
1.1 KiB
Markdown
41 lines
1.1 KiB
Markdown
|
|
# Load Test — Work Order Search (Tier S)
|
||
|
|
|
||
|
|
Harness k6 para validar SLOs da Fase 4 em ambiente local ou staging.
|
||
|
|
|
||
|
|
## Pré-requisitos
|
||
|
|
|
||
|
|
- [k6](https://k6.io/docs/get-started/installation/) instalado
|
||
|
|
- API rodando com JWT válido
|
||
|
|
- (Opcional) Seed sintético: `scripts/seed-work-orders-search.ps1 -Count 15000`
|
||
|
|
|
||
|
|
## Variáveis de ambiente
|
||
|
|
|
||
|
|
| Variável | Descrição | Default |
|
||
|
|
|----------|-----------|---------|
|
||
|
|
| `BASE_URL` | URL base da API | `https://localhost:5001` |
|
||
|
|
| `JWT` | Bearer token | _(obrigatório)_ |
|
||
|
|
| `WEEK_START` | Segunda-feira ISO para board | `2026-06-22` |
|
||
|
|
|
||
|
|
## Execução
|
||
|
|
|
||
|
|
```powershell
|
||
|
|
$env:JWT = "<seu-token>"
|
||
|
|
$env:BASE_URL = "https://localhost:5001"
|
||
|
|
k6 run scripts/load-test/work-order-search.k6.js
|
||
|
|
```
|
||
|
|
|
||
|
|
## SLOs Tier S (p95)
|
||
|
|
|
||
|
|
| Métrica | Limite |
|
||
|
|
|---------|--------|
|
||
|
|
| `board_no_search` | < 800ms |
|
||
|
|
| `board_with_search` | < 1000ms |
|
||
|
|
| `advanced_preset` | < 1200ms |
|
||
|
|
| `advanced_multi_filter` | < 1500ms |
|
||
|
|
|
||
|
|
## Staging (pós Volume Discovery)
|
||
|
|
|
||
|
|
1. Executar `scripts/volume-discovery.ps1`
|
||
|
|
2. Confirmar tier em `docs/work-orders/phase-4/search-tier-decision.md`
|
||
|
|
3. Repetir k6 com volume real; ajustar thresholds se tier = M
|