loadtest benchmark
This commit is contained in:
parent
9b3d4cfd8b
commit
a3f99d0983
@ -19,6 +19,8 @@ wave_loop_max=2
|
|||||||
climb_max=300
|
climb_max=300
|
||||||
climb_connection=30
|
climb_connection=30
|
||||||
kubeless=true
|
kubeless=true
|
||||||
|
#Loadtest specific fonguration
|
||||||
|
loadtest_rps=1000
|
||||||
|
|
||||||
HEY_INSTALLED=$(command -v hey)
|
HEY_INSTALLED=$(command -v hey)
|
||||||
if [[ $HEY_INSTALLED = "" ]]
|
if [[ $HEY_INSTALLED = "" ]]
|
||||||
@ -29,6 +31,14 @@ then
|
|||||||
cp "$HOME"/go/bin/hey /usr/local/bin
|
cp "$HOME"/go/bin/hey /usr/local/bin
|
||||||
fi
|
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"
|
echo -e "Benchmarking functions\n"
|
||||||
for function in "${functions[@]}"
|
for function in "${functions[@]}"
|
||||||
do
|
do
|
||||||
@ -95,14 +105,24 @@ do
|
|||||||
do
|
do
|
||||||
datetime=$(date '+%Y-%m-%d-%H-%M-%S')
|
datetime=$(date '+%Y-%m-%d-%H-%M-%S')
|
||||||
echo -e "Time: $time\n"
|
echo -e "Time: $time\n"
|
||||||
if [[ $* = *"--hey"* ]]
|
if [[ $* = *"--fire"* ]]
|
||||||
then
|
then
|
||||||
echo -e "hey-summary $datetime\n"
|
echo -e "hey-summary $datetime\n"
|
||||||
if $kubeless;
|
if $kubeless;
|
||||||
then
|
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".txt
|
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
|
else
|
||||||
hey -c "$connection" -z "$time" -m POST -host "$function.default.example.com" http://$kuberhost/ > ./data/"$function"."$connection"."$time"."$datetime".txt
|
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
|
||||||
fi
|
fi
|
||||||
if [[ $* = *"--csv"* ]]
|
if [[ $* = *"--csv"* ]]
|
||||||
|
Loading…
Reference in New Issue
Block a user