IT WORKED ON YOUR MACHINE.
NOT ON OURS.

Grafana k6 harness for Rinha de Backend 2024/Q1. Run debit, credit, statement, validation, and missing-client checks with source-backed VU targets.

> MODE=prod BASE_URL=http://api:9999
> scenario: debitos target=220VUs
> scenario: creditos target=110VUs
> scenario: extratos vus=10
> metrics: 5 custom Trend series
> output: quiet k6 CLI logs
>
Scenarios
5
Source-backed k6 executors
Debit Load
220
Peak VUs, 2m ramp + 2m hold
Credit Load
110
Peak VUs, 2m ramp + 2m hold
Trend Metrics
5
One duration series per scenario

TEST SCENARIOS

validacoes

GET /clientes/[id]/extrato

Five VUs, one per configured client, verify initial limits, credit/debit consistency, recent transaction order, and invalid payload handling.

5 VUs · 1 iteration · starts at 0s

cliente_nao_encontrado

GET /clientes/6/extrato

One VU keeps missing-client behavior visible by asserting the non-existent client statement route returns 404.

1 VU · 1 iteration · starts at 0s

debitos

POST /clientes/[id]/transacoes

Ramps debit transactions to 220 VUs, accepts 200 or overdraft 422 responses, and checks successful balances against the client limit.

1 → 220 VUs · 2m ramp + 2m hold

creditos

POST /clientes/[id]/transacoes

Ramps credit transactions to 110 VUs and expects successful responses that preserve the same balance-limit contract.

1 → 110 VUs · 2m ramp + 2m hold

extratos

GET /clientes/[id]/extrato

Ten VUs fetch account statements and verify that the reported total still respects the configured negative limit.

10 VUs · 1 iteration · starts at 10s

⚡ Stress Test Results

Built from the checked-in k6 script and bundled with xk6-output-influxdb. The suite measures latency, status handling, and balance consistency across the Rinha banking API endpoints.