add bombardier stress test script

This commit is contained in:
Sky Johnson 2025-06-13 10:37:41 -05:00
parent 0729179401
commit 538ae9f8b4

23
stress_test.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/bash
urls=(
"http://localhost:8080/"
"http://localhost:8080/request-info"
"http://localhost:8080/users/boobs"
"http://localhost:8080/index.html"
)
pids=()
for i in "${!urls[@]}"; do
bombardier -c 25 -d 30s -p r "${urls[$i]}" > "/tmp/bombardier_$i.out" 2>&1 &
pids+=($!)
done
for pid in "${pids[@]}"; do
wait $pid
done
for i in "${!urls[@]}"; do
reqs_sec=$(grep "Reqs/sec" "/tmp/bombardier_$i.out" | awk '{print $2}')
echo "${urls[$i]}: $reqs_sec req/sec"
rm "/tmp/bombardier_$i.out"
done