X-Git-Url: http://jsfdemo.indexdata.com/?a=blobdiff_plain;f=perf%2Fbash%2Fpp2client.sh;h=03b0421ab3740477f785a197f8723e7be2a67e0d;hb=refs%2Fheads%2Funix_socket;hp=611c0dc7e2a9a3c1be64aef09f6ba677a125955b;hpb=1756a89c4459683cda70b4c2c54c6a687bd3b1fe;p=pazpar2-moved-to-github.git diff --git a/perf/bash/pp2client.sh b/perf/bash/pp2client.sh index 611c0dc..03b0421 100755 --- a/perf/bash/pp2client.sh +++ b/perf/bash/pp2client.sh @@ -9,7 +9,8 @@ Options: Default values [--query=QUERY] water [--service=SERVICE] [--settings=SETTINGS] - [--outfile=OUTFILE] 1 + [--outfile=OUTFILE] + [--timed] EOF exit 1 } @@ -18,6 +19,13 @@ SERVICE="" SETTINGS="" QUERY=water OF=1 +TIME="" + +if test $# -eq 0; then + usage + exit 0; +fi + while test $# -gt 0; do case "$1" in -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; @@ -39,13 +47,22 @@ while test $# -gt 0; do --outfile=*) OF=$optarg ;; + --timed) + TIME="yes" + ;; -*) usage ;; esac shift done -wget -q -O $OF.init.xml "$H/?command=init${SERVICE}" + +if [ "$TIME" != "" ] ; then + /usr/bin/time --format "$OF, init, %e" wget -q -O ${TMP_DIR}$OF.init.xml "$H/?command=init${SERVICE}" 2> ${TMP_DIR}$OF.init.time +else + wget -q -O ${TMP_DIR}$OF.init.xml "$H/?command=init${SERVICE}" +fi + R="$?" if [ "$R" != 0 ]; then if [ "$R" = "4" ]; then @@ -58,11 +75,27 @@ if [ "$R" != 0 ]; then fi S=`xsltproc get_session.xsl $OF.init.xml` if [ -n "$SETTINGS" ] ; then - wget -q -O $OF.settings.xml "$H?command=settings&session=$S&${SETTINGS}" + if [ "$TIME" != "" ] ; then + /usr/bin/time --format "$OF, settings, %e" wget -q -O ${TMP_DIR}$OF.settings.xml "$H?command=settings&session=$S&${SETTINGS}" 2> ${TMP_DIR}$OF.settings.time + else + wget -q -O ${TMP_DIR}$OF.settings.xml "$H?command=settings&session=$S&${SETTINGS}" + fi +fi + +if [ "$TIME" != "" ] ; then + /usr/bin/time --format "$OF, search, %e" wget -q -O ${TMP_DIR}$OF.search.xml "$H?command=search&query=$QUERY&session=$S" 2> ${TMP_DIR}$OF.search.time +else + wget -q -O ${TMP_DIR}$OF.search.xml "$H?command=search&query=$QUERY&session=$S" fi -wget -q -O $OF.search.xml "$H?command=search&query=$QUERY&session=$S" sleep 1 -wget -q -O $OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1" +if [ "$TIME" != "" ] ; then + /usr/bin/time --format "$OF, show, %e" wget -q -O ${TMP_DIR}$OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1" 2> ${TMP_DIR}$OF.show.time +else + wget -q -O ${TMP_DIR}$OF.show.xml "$H?command=show&session=$S&sort=relevance&start=0&num=100&block=1" +fi +wget -q -O ${TMP_DIR}$OF.bytarget.xml "$H?command=bytarget&session=$S" +wget -q -O ${TMP_DIR}$OF.stat.xml "$H?command=stat&session=$S" +wget -q -O ${TMP_DIR}$OF.info.xml "$H?command=info" exit 0 # Local Variables: