diff --git a/stress_test.sh b/stress_test.sh new file mode 100755 index 0000000..d3fd7d6 --- /dev/null +++ b/stress_test.sh @@ -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