From 8c17faad60a0623d642c4ab77d836df294ab1b1a Mon Sep 17 00:00:00 2001 From: Dennis Schafroth Date: Mon, 3 May 2010 11:24:40 +0200 Subject: [PATCH] Manuel merge from dennis_threading branch --- perf/bash/generate_plot.sh | 2 +- perf/bash/par_fixed_clients.sh | 41 +++++++++++++++++++++------------------- 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/perf/bash/generate_plot.sh b/perf/bash/generate_plot.sh index 7c819f0..73a0904 100644 --- a/perf/bash/generate_plot.sh +++ b/perf/bash/generate_plot.sh @@ -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 diff --git a/perf/bash/par_fixed_clients.sh b/perf/bash/par_fixed_clients.sh index a885aae..7684481 100755 --- a/perf/bash/par_fixed_clients.sh +++ b/perf/bash/par_fixed_clients.sh @@ -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 + -- 1.7.10.4