Skip to content

Instantly share code, notes, and snippets.

@not-for-me
Created November 30, 2018 03:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save not-for-me/34b0d4775624359157a122097986a2c4 to your computer and use it in GitHub Desktop.
Save not-for-me/34b0d4775624359157a122097986a2c4 to your computer and use it in GitHub Desktop.
Simple ab test
#!/bin/sh
ARG=($@)
arg_count=${#ARG[@]}
if [[ $arg_count -lt 4 ]]; then
echo "Usage: $0 loopCount (ab -n opt param) (ab -c opt param) url" >&2
exit 1
fi
loop=${ARG[0]}
num=${ARG[1]}
conn=${ARG[2]}
url=${ARG[3]}
i=0
while [ "$i" -lt $loop ];
do
echo "$i times call ab $num, $conn"
ab -n $num -c $conn $url
i=$((i + 1))
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment