add kubeless vs knative choser

This commit is contained in:
Torma Kristóf 2019-10-20 22:20:05 +02:00
parent f9a8b036a7
commit 38d23ada01
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047

View File

@ -18,6 +18,7 @@ wave_loop_max=2
#Climb mode configuration #Climb mode configuration
climb_max=300 climb_max=300
climb_connection=30 climb_connection=30
kubeless=true
HEY_INSTALLED=$(command -v hey) HEY_INSTALLED=$(command -v hey)
if [[ $HEY_INSTALLED = "" ]] if [[ $HEY_INSTALLED = "" ]]
@ -35,7 +36,12 @@ do
echo -e "Benchmarking $function\n" echo -e "Benchmarking $function\n"
echo -e "Output of $function is:\n" echo -e "Output of $function is:\n"
perl -pi -e 'chomp if eof' "$function_friendly".body perl -pi -e 'chomp if eof' "$function_friendly".body
if [[ $kubeless ]]
then
curl --data-binary @"$function_friendly".body --header "Host: $function.kubeless" --header "Content-Type:application/json" http://$kuberhost/"$function" curl --data-binary @"$function_friendly".body --header "Host: $function.kubeless" --header "Content-Type:application/json" http://$kuberhost/"$function"
else
curl --header "Host: $function.default.example.com" http://$kuberhost/
fi
echo -e "\n" echo -e "\n"
if [[ $* = *"--wave"* ]] if [[ $* = *"--wave"* ]]
then then
@ -46,7 +52,12 @@ do
now=$(date '+%Y-%m-%d-%H-%M') now=$(date '+%Y-%m-%d-%H-%M')
echo -e "Connections: $wave_connection" echo -e "Connections: $wave_connection"
echo -e "Running" echo -e "Running"
if [[ $kubeless ]]
then
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$wave_num".wave.csv hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$wave_num".wave.csv
else
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$wave_num".wave.csv
fi
wave_num=$((wave_num + 1)) wave_num=$((wave_num + 1))
if $wave_dir_up if $wave_dir_up
then then
@ -87,18 +98,34 @@ do
if [[ $* = *"--hey"* ]] if [[ $* = *"--hey"* ]]
then then
echo -e "hey-summary $datetime\n" echo -e "hey-summary $datetime\n"
if [[ $kubeless ]]
then
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".hey.txt 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".hey.txt
else
hey -c "$connection" -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".hey.txt
fi
fi fi
if [[ $* = *"--csv"* ]] if [[ $* = *"--csv"* ]]
then then
echo -e "hey-csv $datetime\n" echo -e "hey-csv $datetime\n"
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$connection"."$time"."$datetime".csv if [[ $kubeless ]]
then
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".hey.txt
else
hey -c "$connection" -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".hey.txt
fi
fi fi
if [[ $* = *"--for"* ]] if [[ $* = *"--for"* ]]
then
for num in 1 2 3 4 5 6 7 8 9 10 for num in 1 2 3 4 5 6 7 8 9 10
do do
echo -e "hey-for $datetime\n" echo -e "hey-for $num\n"
if [[ $kubeless ]]
then
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$num".csv hey -c "$connection" -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$num".csv
else
hey -c "$connection" -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$num".csv
fi
done done
fi fi
echo -e "Finished at $datetime" echo -e "Finished at $datetime"
@ -106,10 +133,16 @@ do
done done
fi fi
if [[ $* = *"--climb"* ]] if [[ $* = *"--climb"* ]]
then
while [[ $climb_connection -lt $climb_max ]]; do while [[ $climb_connection -lt $climb_max ]]; do
echo -e "Connections: $wave_connection" echo -e "Connections: $wave_connection"
echo -e "Running" echo -e "Running"
hey -c $wave_connection -z $wave_time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$climb_connection".wave.csv if [[ $kubeless ]]
then
hey -c $climb_connection -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" > ./data/"$function"."$climb_connection".wave.csv
else
hey -c $climb_connection -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$climb_connection".wave.csv
fi
climb_connection=$((climb_connection + 10)) climb_connection=$((climb_connection + 10))
done done
fi fi