-
Notifications
You must be signed in to change notification settings - Fork 928
/
executar-teste-local.ps1
31 lines (27 loc) · 983 Bytes
/
executar-teste-local.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Use este script para executar testes locais
$RESULTS_WORKSPACE = "$(Get-Location)\load-test\user-files\results"
$GATLING_BIN_DIR = "$env:GATLING_HOME\bin"
$GATLING_WORKSPACE = "$(Get-Location)\load-test\user-files"
function Run-Gatling {
& "$GATLING_BIN_DIR\gatling.bat" -rm local -s RinhaBackendCrebitosSimulation `
-rd "Rinha de Backend - 2024/Q1: Crébito" `
-rf $RESULTS_WORKSPACE `
-sf "$GATLING_WORKSPACE/simulations"
}
function Start-Test {
for ($i = 1; $i -le 20; $i++) {
Write-Output $i
try {
# 2 requests to wake the 2 API instances up :)
Invoke-RestMethod -Uri "http://localhost:9999/clientes/1/extrato" -ErrorAction Stop
Write-Host ""
Invoke-RestMethod -Uri "http://localhost:9999/clientes/1/extrato" -ErrorAction Stop
Write-Host ""
Run-Gatling
break
} catch {
Start-Sleep -Seconds 2
}
}
}
Start-Test