This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Bootstrap: AWS EC2 Ubuntu 24.04 → simular starly local com crowpay-api | |
| # Uso: GH_TOKEN=<pat> bash aws-bootstrap.sh | |
| set -e | |
| if [ -z "$GH_TOKEN" ]; then | |
| echo "ERROR: precisa GH_TOKEN=<github personal access token com scope 'repo'>" | |
| exit 1 | |
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| export SK=sk_test_xHNopk5u1rgnSZdCKCjp8xu1CBQI2HkY | |
| export OFFER_ID=WG87 | |
| export BASE_URL=https://api.crowpay.black | |
| export SK_TEST_KEY=$SK | |
| mkdir -p ~/results | |
| echo "=== Preflight warm x3 ===" | |
| for i in 1 2 3; do | |
| curl -sS -w "warm-$i: HTTP=%{http_code} t=%{time_total}s\n" -o /dev/null $BASE_URL/v1/transactions -X POST -H "Authorization: Bearer $SK" -H "Content-Type: application/json" -H "Idempotency-Key: pfwarm-$i-$RANDOM" -d "{\"offer_id\":\"$OFFER_ID\",\"buyer\":{\"name\":\"PF\",\"email\":\"p@f.test\",\"cpf\":\"03953676031\",\"phone\":\"+5511999999999\"},\"payment_method\":\"pix\"}" | |
| done |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { check } from "k6"; | |
| import http from "k6/http"; | |
| /** | |
| * tests/load/scenarios/find-knee.js — varredura de capacidade (J-DIAGNOSIS round 11+). | |
| * | |
| * Roda uma janela de carga SUSTENTADA em uma TAXA FIXA configurável via env | |
| * (`RATE`), por uma duração configurável (`DURATION`, default 30s). Não é o | |
| * gate D-07 (esse fica em `simulator.js`) — esse script existe pra mapear a | |
| * curva latência×throughput e achar a taxa máxima sob o SLO p99<300ms. |