From 79f0d945dbf4620860fde398a8fb22e2b7a1c150 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 21 Feb 2010 12:02:58 +0100 Subject: [PATCH] Performance tests - bash based --- perf/bash/.gitignore | 2 ++ perf/bash/README | 17 +++++++++++++++++ perf/bash/client.sh | 11 +++++++++++ perf/bash/get_session.xsl | 13 +++++++++++++ perf/bash/par.sh | 9 +++++++++ 5 files changed, 52 insertions(+) create mode 100644 perf/bash/.gitignore create mode 100644 perf/bash/README create mode 100755 perf/bash/client.sh create mode 100644 perf/bash/get_session.xsl create mode 100755 perf/bash/par.sh diff --git a/perf/bash/.gitignore b/perf/bash/.gitignore new file mode 100644 index 0000000..0da406c --- /dev/null +++ b/perf/bash/.gitignore @@ -0,0 +1,2 @@ +*.log +*.xml diff --git a/perf/bash/README b/perf/bash/README new file mode 100644 index 0000000..7433b58 --- /dev/null +++ b/perf/bash/README @@ -0,0 +1,17 @@ +# Script to test performance for local ztest's. + +client.sh - single session dong init, search, show +par.sh - parallel invocation of client.sh +get_session.xsl - get session from response + +Start in one session pazpar2: +cd etc +../src/pazpar2 -f perf.xml -X + +Start in one session yaz-ztest: +yaz-ztest + +Start the par.sh: +./par.sh + + diff --git a/perf/bash/client.sh b/perf/bash/client.sh new file mode 100755 index 0000000..6f9e076 --- /dev/null +++ b/perf/bash/client.sh @@ -0,0 +1,11 @@ +#!/bin/bash +O=$1 +if test -z "$O"; then + O=1 +fi +H='http://localhost:9004/search.pz2' +wget -q -O $O.init.xml "$H/?command=init" +S=`xsltproc get_session.xsl $O.init.xml` +wget -q -O $O.search.xml "$H?command=search&query=utah&session=$S" +sleep 0.5 +wget -q -O $O.show.xml "$H?command=show&session=$S" diff --git a/perf/bash/get_session.xsl b/perf/bash/get_session.xsl new file mode 100644 index 0000000..e26eb76 --- /dev/null +++ b/perf/bash/get_session.xsl @@ -0,0 +1,13 @@ + + + + + + + + + + diff --git a/perf/bash/par.sh b/perf/bash/par.sh new file mode 100755 index 0000000..d85b598 --- /dev/null +++ b/perf/bash/par.sh @@ -0,0 +1,9 @@ +#!/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 +done -- 1.7.10.4