nginx-profile-setup/kaclient/run.sh

36 lines
556 B
Bash
Raw Normal View History

#!/bin/bash
function log_request_to () {
return_code=$(curl -Sikl -o /dev/null -w "%{http_code}" $1 2>/dev/null)
case ${return_code:0:1} in
"4" | "5")
echo "query of $1 returned $return_code"
return 1
;;
*)
return 0
;;
esac
}
function do_wrk_on () {
/wrk/wrk -t1 -c10 $1 &
}
function sigint_handler() {
jobs -p | xargs kill -9
exit
}
trap 'sigint_handler' INT
# TODO: make this a more elegant item
# maybe a while loop with curl
sleep 0.5
for iter in {0.999}; do
do_wrk_on "https://kaproxy:8080/$iter"
done
wait $(jobs -p)