diff options
author | Alan Conway <aconway@apache.org> | 2007-11-28 15:35:03 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-11-28 15:35:03 +0000 |
commit | 5585bb72a37e9d483a20ff0ab86cb55eaa98d039 (patch) | |
tree | 3d7645d3283469228bc1bf92f8796d9cabaab062 /cpp/src | |
parent | 17e755377850471604644942c22e41d7a27172d0 (diff) | |
download | qpid-python-5585bb72a37e9d483a20ff0ab86cb55eaa98d039.tar.gz |
src/tests/perfdist: Updated for changes to perftest.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@599028 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rwxr-xr-x | cpp/src/tests/perfdist | 60 |
1 files changed, 42 insertions, 18 deletions
diff --git a/cpp/src/tests/perfdist b/cpp/src/tests/perfdist index 6c5d6b6b11..8705cac7eb 100755 --- a/cpp/src/tests/perfdist +++ b/cpp/src/tests/perfdist @@ -1,32 +1,56 @@ #!/bin/bash # +set -e usage() { cat <<EOF -Distributed perftest with ssh. -Arguments before -- are passed to perftest. -Arguments after -- are treated as host names. -Publisher runs on first host. One listener runs on each -Remaining host. To run multiple liseners on a host, list it more than once. -Do not pass --consumers, --publish or --listen options, they are computed -from the host list. +usage: $0 <perftest-args> --pubhosts <publish-hosts> --subhosts <subscribe-hosts> + +All perftest args must come before --pubhost or --subhost. Runs one +publish process on each publish-host, one subscribe process on each +subscribe-host. To run multiple processes on the same host, list it +more than once. + +Do not pass action flags --setup, --control, --publish, --subscribe they +will be passed to the appropriate processes. + +Do not pass --nsubs or --npubs, they are calculated by counting the host lists. EOF exit 1 } -while test "$HOSTS" != "$*"; do +while test $# -gt 0; do case $1 in - --consumers|--publish|--listen) usage ;; - --) shift; PUB="$1" ; shift ; HOSTS="$*" ;; + --publish|--subscribe|--setup|--control|--npubs|--nsubs) usage ;; + --pubhosts) COLLECT=PUBHOSTS; shift; break ;; + --subhosts) COLLECT=SUBHOSTS; shift; break ;; *) ARGS="$ARGS $1"; shift ;; esac done -test -n "$HOSTS" || { echo "No -- found"; usage; } -N=`echo $HOSTS | wc -w` -PERFTEST=`PATH=$PWD:$PATH which perftest` -$PERFTEST --purge $ARGS -ssh $PUB $PERFTEST $ARGS --publish --consumers $N& -for h in $HOSTS; do - ssh $h $PERFTEST $ARGS --listen& + +if [ -z "$COLLECT" ]; then echo "No --pubhost or --subhost specified"; usage; fi + +while test $# -gt 0; do + case $1 in + --pubhosts) COLLECT=PUBHOSTS; shift ;; + --subhosts) COLLECT=SUBHOSTS; shift ;; + *) eval "$COLLECT=\"\$$COLLECT $1\""; shift ;; + esac done -wait +if [ -z "$PUBHOSTS" ]; then echo "Missing --pubhost or --subhost"; usage; fi +if [ -z "$SUBHOSTS" ]; then echo "Missing --subhost or --subhost"; usage; fi + +NPUBS=`echo $PUBHOSTS | wc -w` +NSUBS=`echo $SUBHOSTS | wc -w` +ARGS="$ARGS --npubs $NPUBS --nsubs $NSUBS" +PERFTEST="`PATH=$PWD:$PATH which perftest` $ARGS" + +start() { + echo $1 on $2 + ssh $2 $PERFTEST --$1 +} + +$PERFTEST --setup +for h in $PUBHOSTS; do start publish $h & done +for h in $SUBHOSTS; do start subscribe $h & done +$PERFTEST --control |