echo "plot 'range.stat' using 1:2 title 'init', 'range.stat'using 1:3 title 'search', 'range.stat'using 1:4 title 'show'" >> range.gnuplot
echo "plot 'init.stat' using 1:2 title 'init'" >> init.gnuplot
echo "plot 'search.stat' using 1:2 title 'Search'" >> search.gnuplot
-echo "plot 'search.stat' using 1:2 title 'Search'" >> show.gnuplot
+echo "plot 'search.stat' using 1:2 title 'Show'" >> show.gnuplot
if [ "$1" != "" ] ; then
gnuplot < range.gnuplot > range.$1
NUMBER=20
fi
-DELAY=0.001
-WAIT=1
-#NUMBER=100
-ROUNDS=2
+MAX_DELAY=1
+CLIENT_WAIT=2
+ROUNDS=10
let r=0
-PORT=9005
+PORT=$2
+SERVICE=$3
CLIENT_SCRIPT="client_timed.sh"
+rm -f *.time
while test $r -lt $ROUNDS; do
- echo "$r"
- i=0
- while test $i -lt $NUMBER; do
- ./${CLIENT_SCRIPT} $r.$i $PORT >$r.$i.log 2>&1 &
- CLIENTS=`ps -ef |grep -c ${CLIENT_SCRIPT}`
- while test $CLIENTS -ge $NUMBER ; do
- sleep $WAIT
- CLIENTS=`ps -ef |grep -c ${CLIENT_SCRIPT}`
- echo "Active $CLIENTS"
- done
- let i=$i+1
+ echo "$r"
+ i=0
+ while test $i -lt $NUMBER; do
+ ./${CLIENT_SCRIPT} $r.$i $PORT $SERVICE >$r.$i.log 2>&1 &
+ SLEEP=$[ ( $RANDOM % $MAX_DELAY ) ]
+ sleep $SLEEP
+ CLIENTS=`ps -ef |grep ${CLIENT_SCRIPT} | grep -cv grep`
+ while test $CLIENTS -ge $NUMBER ; do
+ sleep $CLIENT_WAIT
+ CLIENTS=`ps -ef |grep ${CLIENT_SCRIPT} |grep -cv grep `
+ echo "Active $CLIENTS"
done
- let r=$r+1
+ let i=$i+1
+ done
+ let r=$r+1
done
wait
-cat *.time > timed.$NUMBER.log
+cat *.time >> timed.$SERVICE.$NUMBER.log
#wget --tries=1 -O x "http://localhost:${PORT}/?command=exit"
-sleep 5
\ No newline at end of file
+