watcher script

This commit is contained in:
Torma Kristóf 2019-10-29 13:35:44 +01:00
parent bb9ca10bad
commit bdb1b3649f
Signed by: tormakris
GPG Key ID: DC83C4F2C41B1047
2 changed files with 16 additions and 6 deletions

View File

@ -53,13 +53,13 @@ for function in "${functions[@]}"; do
echo -e "summary $datetime\n"
if $kubeless; then
if [[ $* == *"--loadtest"* ]]; then
loadtest -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$connection"."$time"."$datetime".txt
loadtest -k -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$connection"."$time"."$datetime".txt
else
hey -c "$connection" -q $rps -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 $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$connection"."$time"."$datetime".txt
loadtest -k -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$connection"."$time"."$datetime".txt
else
hey -c "$connection" -q $rps -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$connection"."$time"."$datetime".txt
fi
@ -78,13 +78,13 @@ for function in "${functions[@]}"; do
echo -e "for $num\n"
if $kubeless; then
if [[ $* == *"--loadtest"* ]]; then
loadtest -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$num".txt
loadtest -k -H "Host: $function.kubeless" --rps $rps -c $connection -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$num".txt
else
hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$num".csv
fi
else
if [[ $* == *"--loadtest"* ]]; then
loadtest -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$num".for.csv
loadtest -k -H "Host: $function.default.example.com" --rps $rps -c $connection -t $time http://$kuberhost/ >./data/"$function"."$num".for.csv
else
hey -c "$connection" -q $rps -z "$time" -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$num".for.csv
fi
@ -99,13 +99,13 @@ for function in "${functions[@]}"; do
echo -e "Connections: $climb_connection"
if $kubeless; then
if [[ $* == *"--loadtest"* ]]; then
loadtest -H "Host: $function.kubeless" --rps $climb_rps -c 1 -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$climb_connection".climb.txt
loadtest -k -H "Host: $function.kubeless" --rps $climb_rps -c 1 -t $time -p "$function_firendly".body http://$kuberhost/"$function" >./data/"$function"."$climb_connection".climb.txt
else
hey -c 1 -q $climb_rps -z $time -m POST -o csv -host "$function.kubeless" -D "$function_friendly".body -T "application/json" http://$kuberhost/"$function" >./data/"$function"."$climb_connection".climb.csv
fi
else
if [[ $* == *"--loadtest"* ]]; then
loadtest -H "Host: $function.default.example.com" --rps $climb_rps -c 1 -t $time http://$kuberhost/ >./data/"$function"."$climb_connection".climb.txt
loadtest -k -H "Host: $function.default.example.com" --rps $climb_rps -c 1 -t $time http://$kuberhost/ >./data/"$function"."$climb_connection".climb.txt
else
hey -c 1 -q $climb_rps -z $time -m POST -o csv -host "$function.default.example.com" http://$kuberhost/ >./data/"$function"."$climb_connection".climb.csv
fi

View File

@ -0,0 +1,10 @@
#!/usr/bin/env bash
time=300
function=hello-kubeless-go-sc
for (( i = 1 ; i <= $time ; i++ )); do
kubectl get deployment | grep $function | awk '{print $2}' | cut -d/ -f1 >> ./data/$function.monitor.csv
echo '\n' >> ./data/$function.monitor.csv
sleep 1
done