diff --git a/test/ex3.sh b/test/ex3.sh index 9b631e9..d612509 100755 --- a/test/ex3.sh +++ b/test/ex3.sh @@ -1,38 +1,39 @@ +#echo "[ex3.sh] Calling repeattest with api gateway url = " $1 +#./partest.sh 100 100 1 1 | tail -n 1 >> .myruns ./repeattest.sh 10 echo "10 second sleep" echo "-----------------------------------------------------------------------------------------------------------------------------" ./repeattest.sh 60 -exit +#exit echo "60 second sleep" echo "-----------------------------------------------------------------------------------------------------------------------------" ./repeattest.sh 300 echo "5 min sleep" echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 600 -echo "10 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 900 -echo "15 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 1200 -echo "20 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 1500 -echo "25 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 1800 -echo "30 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 2100 -echo "35 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 2400 -echo "40 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 2700 -echo "45 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" -./repeattest.sh 3000 -echo "50 min sleep" -echo "-----------------------------------------------------------------------------------------------------------------------------" - +#./repeattest.sh 480 +#echo "8 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 600 +#echo "10 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 720 +#echo "12 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 840 +#echo "14 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 1800 +#echo "30 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 2100 +#echo "35 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 2400 +#echo "40 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 2700 +#echo "45 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" +#./repeattest.sh 3000 +#echo "50 min sleep" +#echo "-----------------------------------------------------------------------------------------------------------------------------" diff --git a/test/partest.sh b/test/partest.sh index 2180809..9f9cb0f 100755 --- a/test/partest.sh +++ b/test/partest.sh @@ -37,7 +37,7 @@ callservice() { #(2) - light calcs - 20,000 #json={"\"name\"":"\"\",\"calcs\"":1000,\"sleep\"":0,\"loops\"":20} - #(3) - medium calcs 200,000 + #(3) - medium calcs 200,000 #json={"\"name\"":"\"\",\"calcs\"":10000,\"sleep\"":0,\"loops\"":20} #(4) - somewhat heavy calcs - 500,000 @@ -59,15 +59,15 @@ callservice() { #json={"\"name\"":"\"\",\"calcs\"":100000,\"sleep\"":0,\"loops\"":100} time1=( $(($(date +%s%N)/1000000)) ) - #uuid=`curl -H "Content-Type: application/json" -X POST -d "{\"name\": \"Fred\"}" https://ue5e0irnce.execute-api.us-east-1.amazonaws.com/test/test 2>/dev/null | cut -d':' -f 3 | cut -d'"' -f 2` + #uuid=`curl -H "Content-Type: application/json" -X POST -d "{\"name\": \"Fred\"}" https://ue5e0irnce.execute-api.us-east-1.amazonaws.com/test/test 2>/dev/null | cut -d':' -f 3 | cut -d'"' -f 2` ####output=`curl -H "Content-Type: application/json" -X POST -d $json https://a9gseqxep9.execute-api.us-east-1.amazonaws.com/test2/test 2>/dev/null` ###output=`curl -H "Content-Type: application/json" -X POST -d $json https://ctbiwxx3f3.execute-api.us-east-1.amazonaws.com/dev1 2>/dev/null` output=`curl -H "Content-Type: application/json" -X POST -d $json https://ue5e0irnce.execute-api.us-east-1.amazonaws.com/test/test 2>/dev/null` #output=`curl -H "Content-Type: application/json" -X POST -d $json https://b3euo2n6s7.execute-api.us-east-1.amazonaws.com/test 2>/dev/null` ########################output=`curl -H "Content-Type: application/json" -X POST -d $json https://i1dc63pzgh.execute-api.us-east-1.amazonaws.com/test5/ 2>/dev/null` - #output=`curl -H "Content-Type: application/json" -X POST -d $json https://ue5e0irnce.execute-api.us-east-1.amazonaws.com/test/test 2>/dev/null | cut -d':' -f 3 | cut -d'"' -f 2` + #output=`curl -H "Content-Type: application/json" -X POST -d $json https://ue5e0irnce.execute-api.us-east-1.amazonaws.com/test/test 2>/dev/null | cut -d':' -f 3 | cut -d'"' -f 2` - # parsing when /proc/cpuinfo is not requested + # parsing when /proc/cpuinfo is not requested #uuid=`echo $output | cut -d':' -f 3 | cut -d'"' -f 2` #cpuusr=`echo $output | cut -d':' -f 4 | cut -d',' -f 1` #cpukrn=`echo $output | cut -d':' -f 5 | cut -d',' -f 1` @@ -81,7 +81,7 @@ callservice() { #pid=`echo $output | cut -d',' -f 5 | cut -d':' -f 2 | cut -d'"' -f 2` #cpusteal=`echo $output | cut -d'"' -f 4 | cut -d' ' -f 9` #cputype="unknwn" - + # parsing when /proc/cpuinfo is requested uuid=`echo $output | cut -d',' -f 2 | cut -d':' -f 2 | cut -d'"' -f 2` cpuusr=`echo $output | cut -d',' -f 3 | cut -d':' -f 2` @@ -92,7 +92,7 @@ callservice() { cpusteal=`echo $output | cut -d',' -f 13 | cut -d':' -f 2` vuptime=`echo $output | cut -d',' -f 14 | cut -d':' -f 2` newcont=`echo $output | cut -d',' -f 15 | cut -d':' -f 2` - + time2=( $(($(date +%s%N)/1000000)) ) elapsedtime=`expr $time2 - $time1` sleeptime=`echo $onesecond - $elapsedtime | bc -l` @@ -163,7 +163,7 @@ do ## if state = 2 compare against file to obtain total count of recycled containers used } - ## so this is where we need to process the + ## so this is where we need to process the if [ $found != 1 ]; then containers+=($uuid) chosts+=($host) @@ -204,8 +204,8 @@ echo "uuid,host,uses,totaltime,avgruntime_cont,uses_minus_avguses_sq" total=0 for ((i=0;i < ${#containers[@]};i++)) { avg=`echo ${ctimes[$i]} / ${cuses[$i]} | bc -l` - stdiff=`echo ${cuses[$i]} - $runspercont | bc -l` - stdiffsq=`echo "$stdiff * $stdiff" | bc -l` + stdiff=`echo ${cuses[$i]} - $runspercont | bc -l` + stdiffsq=`echo "$stdiff * $stdiff" | bc -l` total=`echo $total + $stdiffsq | bc -l` #echo "$total + $stdiffsq" echo "${containers[$i]},${chosts[$i]},${cuses[$i]},${ctimes[$i]},$avg,$stdiffsq" @@ -228,12 +228,12 @@ echo "host,host_up_time,uses,containers,totaltime,avgruntime_host,uses_minus_avg total=0 if [[ ! -z $vmreport && $vmreport -eq 1 ]] then - rm .origvm + rm .origvm fi for ((i=0;i < ${#hosts[@]};i++)) { avg=`echo ${htimes[$i]} / ${huses[$i]} | bc -l` - stdiff=`echo ${huses[$i]} - $runsperhost | bc -l` - stdiffsq=`echo "$stdiff * $stdiff" | bc -l` + stdiff=`echo ${huses[$i]} - $runsperhost | bc -l` + stdiffsq=`echo "$stdiff * $stdiff" | bc -l` total=`echo $total + $stdiffsq | bc -l` ccount=0 uptime=`echo $currtime - ${hosts[$i]} | bc -l` @@ -242,15 +242,15 @@ for ((i=0;i < ${#hosts[@]};i++)) { then (( ccount ++ )) fi - } + } echo "${hosts[$i]},$uptime,${huses[$i]},$ccount,${htimes[$i]},$avg,$stdiffsq" - ## + ## ## Generate .origvm file to support determing infrastructure recycling stats ## - if [[ ! -z $vmreport && $vmreport -eq 1 ]] + if [[ ! -z $vmreport && $vmreport -eq 1 ]] then - echo "${hosts[$i]}" >> .origvm + echo "${hosts[$i]}" >> .origvm fi if [[ ! -z $vmreport && $vmreport -eq 2 ]] then @@ -276,14 +276,7 @@ stdevhost=`echo $total / ${#hosts[@]} | bc -l` # Generate CSV output - report summary, final data ######################################################################################################################################################### # -# +# # echo "containers,newcontainers,recycont,hosts,recyvms,avgruntime,runs_per_container,runs_per_cont_stdev,runs_per_host,runs_per_host_stdev" echo "${#containers[@]},$newconts,$recycont,${#hosts[@]},$recyvms,$avgtime,$runspercont,$stdev,$runsperhost,$stdevhost" - - - - - - - diff --git a/test/repeattest.sh b/test/repeattest.sh index d5174c8..b971957 100755 --- a/test/repeattest.sh +++ b/test/repeattest.sh @@ -2,18 +2,18 @@ totalruns=1 # time to sleep in seconds between runs -sleep=$1 +sleep_param=$1 for (( i=1 ; i <= $totalruns; i++ )) do echo "Run #$i-----------------------------------------------------------------------------" - ./partest.sh 100 100 - echo -n "sleeping for $sleep seconds - press ctrl-C to exit" - for (( j=1 ; j <= $sleep; j++ )) - do - #sleep 1 - echo -n "." - done - echo "" + ./partest.sh 100 100 2 2 | tail -n 1 >> .myruns + echo -n "sleeping for $sleep_param seconds - press ctrl-C to exit" + sleep $sleep_param + #for (( j=1 ; j <= $sleep_param; j++ )) + #do + # sleep 1 + # echo -n "." + #done + # echo "" done - diff --git a/test/simulations-ex3.sh b/test/simulations-ex3.sh new file mode 100755 index 0000000..b8562ef --- /dev/null +++ b/test/simulations-ex3.sh @@ -0,0 +1,12 @@ +# total runs to perform +#rm -f .myruns +totalEx3Runs=5 +# API Gateway endpoint +apigateway=$1 +echo "[simulations-ex3.sh] Running ex3.sh using API Gateway: " $apigateway +for (( i=1 ; i <= $totalEx3Runs; i++ )) +do + echo "[simulations-ex3.sh] Run #$i for ex3.sh -----------------------------------------------------------------------" + ./ex3.sh +done +