Merge branch 'master' of ssh://git.indexdata.com/home/git/pub/pazpar2
authorDennis Schafroth <dennis@indexdata.com>
Mon, 15 Mar 2010 11:27:09 +0000 (12:27 +0100)
committerDennis Schafroth <dennis@indexdata.com>
Mon, 15 Mar 2010 11:27:09 +0000 (12:27 +0100)
perf/bash/client.sh
perf/bash/par.sh
perf/bash/par_fixed_clients.sh [new file with mode: 0755]
src/connection.c

index a1072f3..06aa523 100755 (executable)
@@ -1,11 +1,11 @@
 #!/bin/bash
-O=$1
-if test -z "$O"; then
-       O=1
+OF=$1
+if test -z "$OF"; then
+       OF=1
 fi
 H='http://localhost:9004/search.pz2'
-wget -q -O $O.init.xml "$H/?command=init&service=perf"
-S=`xsltproc get_session.xsl $O.init.xml`
-wget -q -O $O.search.xml "$H?command=search&query=utah&session=$S"
+wget -q -O $OF.init.xml "$H/?command=init&service=perf&extra=$OF"
+S=`xsltproc get_session.xsl $OF.init.xml`
+wget -q -O $OF.search.xml "$H?command=search&query=100&session=$S"
 sleep 0.5
-wget -q -O $O.show.xml "$H?command=show&session=$S"
+wget -q -O $OF.show.xml "$H?command=show&session=$S"
index d85b598..236907f 100755 (executable)
@@ -1,9 +1,19 @@
 #!/bin/bash
-DELAY=0.1
-NUMBER=10
-let i=0
-while test $i -lt $NUMBER; do
-       ./client.sh $i >$i.log 2>&1 &
-       sleep $DELAY
-       let i=$i+1
+DELAY=0.001
+WAIT=5
+NUMBER=40
+ROUNDS=5
+let r=0
+while test $r -lt $ROUNDS; do
+       echo "$r"
+       let i=0
+       while test $i -lt $NUMBER; do
+               ./client.sh $r.$i >$r.$i.log 2>&1 &
+               sleep $DELAY
+               let i=$i+1
+       done
+       sleep $WAIT
+       let r=$r+1
 done
+wait
+wget -O x 'http://localhost:9004/?command=exit'
diff --git a/perf/bash/par_fixed_clients.sh b/perf/bash/par_fixed_clients.sh
new file mode 100755 (executable)
index 0000000..7dc8779
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/bash
+DELAY=0.001
+WAIT=1
+NUMBER=100
+ROUNDS=5
+let r=0
+while test $r -lt $ROUNDS; do
+       echo "$r"
+       i=0
+       while test $i -lt $NUMBER; do
+               ./client.sh $r.$i >$r.$i.log 2>&1 &
+               CLIENTS=`ps -ef |grep -c client.sh` 
+               while test $CLIENTS -ge $NUMBER ; do
+                   sleep $WAIT
+                   CLIENTS=`ps -ef |grep -c client.sh` 
+                   echo "Active $CLIENTS"
+               done
+               let i=$i+1
+       done
+       let r=$r+1
+done
+wait
+wget -O x 'http://localhost:8010/?command=exit'
index 1525dfb..cfa1146 100644 (file)
@@ -79,7 +79,7 @@ static int connection_is_idle(struct connection *co)
     if (!ZOOM_connection_is_idle(link))
         return 0;
     event = ZOOM_connection_peek_event(link);
-    if (event == ZOOM_EVENT_NONE || event == ZOOM_EVENT_END)
+    if (event == ZOOM_EVENT_NONE)
         return 1;
     else
         return 0;