Manuel merge from dennis_threading branch
authorDennis Schafroth <dennis@indexdata.com>
Mon, 3 May 2010 09:24:40 +0000 (11:24 +0200)
committerDennis Schafroth <dennis@indexdata.com>
Mon, 3 May 2010 09:24:40 +0000 (11:24 +0200)
perf/bash/generate_plot.sh
perf/bash/par_fixed_clients.sh

index 7c819f0..73a0904 100644 (file)
@@ -14,7 +14,7 @@ fi
 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
index a885aae..7684481 100755 (executable)
@@ -4,29 +4,32 @@ if [ -z "$NUMBER" ] ; then
     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
+