Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
59 changes: 30 additions & 29 deletions test/ex3.sh
Original file line number Diff line number Diff line change
@@ -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 "-----------------------------------------------------------------------------------------------------------------------------"
41 changes: 17 additions & 24 deletions test/partest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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`
Expand All @@ -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`
Expand All @@ -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`
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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"
Expand All @@ -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`
Expand All @@ -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
Expand All @@ -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"







20 changes: 10 additions & 10 deletions test/repeattest.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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

12 changes: 12 additions & 0 deletions test/simulations-ex3.sh
Original file line number Diff line number Diff line change
@@ -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