loadtest benchmark
This commit is contained in:
parent
9b3d4cfd8b
commit
a3f99d0983
@ -19,6 +19,8 @@ wave_loop_max=2
|
||||
climb_max=300
|
||||
climb_connection=30
|
||||
kubeless=true
|
||||
#Loadtest specific fonguration
|
||||
loadtest_rps=1000
|
||||
|
||||
HEY_INSTALLED=$(command -v hey)
|
||||
if [[ $HEY_INSTALLED = "" ]]
|
||||
@ -29,6 +31,14 @@ then
|
||||
cp "$HOME"/go/bin/hey /usr/local/bin
|
||||
fi
|
||||
|
||||
LOADTEST_INSTALLED=$(command -v loadtest)
|
||||
if [[ LOADTEST_INSTALLED = "" ]]
|
||||
then
|
||||
apt update
|
||||
apt install -y nodejs npm
|
||||
npm i -g loadtest
|
||||
fi
|
||||
|
||||
echo -e "Benchmarking functions\n"
|
||||
for function in "${functions[@]}"
|
||||
do
|
||||
@ -95,16 +105,26 @@ do
|
||||
do
|
||||
datetime=$(date '+%Y-%m-%d-%H-%M-%S')
|
||||
echo -e "Time: $time\n"
|
||||
if [[ $* = *"--hey"* ]]
|
||||
if [[ $* = *"--fire"* ]]
|
||||
then
|
||||
echo -e "hey-summary $datetime\n"
|
||||
if $kubeless;
|
||||
then
|
||||
if [[ $* = *"--loadtest"* ]]
|
||||
then
|
||||
loadtest -H Host: $function.kubeless --rps $leadtest_rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt
|
||||
else
|
||||
hey -c "$connection" -z "$time" -m POST -host "$function.kubeless" -D "$function_firendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".txt
|
||||
fi
|
||||
else
|
||||
if [[ $* = *"--loadtest"* ]]
|
||||
then
|
||||
loadtest -H Host: $function.default.example.com --rps $leadtest_rps -c $connection -t $time http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt
|
||||
else
|
||||
hey -c "$connection" -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
if [[ $* = *"--csv"* ]]
|
||||
then
|
||||
echo -e "hey-csv $datetime\n"
|
||||
|
Loading…
Reference in New Issue
Block a user