diff options
author | Alan Conway <aconway@apache.org> | 2007-12-05 16:01:06 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-12-05 16:01:06 +0000 |
commit | e1d50902d3d872975b9bac12bb52f2edb93a88e9 (patch) | |
tree | 2d60182874a4d5263bb7f35ec49af95bfbc7c1aa /qpid/cpp/src/tests/perfdist | |
parent | 387a53a7dd18dd0bd3dd4a36b2a600cfbd60f249 (diff) | |
download | qpid-python-e1d50902d3d872975b9bac12bb52f2edb93a88e9.tar.gz |
Fixed problems with setting pub/sub hosts.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@601381 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/perfdist')
-rwxr-xr-x | qpid/cpp/src/tests/perfdist | 31 |
1 files changed, 12 insertions, 19 deletions
diff --git a/qpid/cpp/src/tests/perfdist b/qpid/cpp/src/tests/perfdist index c042fffeac..820fc535cb 100755 --- a/qpid/cpp/src/tests/perfdist +++ b/qpid/cpp/src/tests/perfdist @@ -15,31 +15,22 @@ EOF exit 1 } -while test $# -gt 0; do - case $1 in - --publish|--subscribe|--setup|--control|--npubs|--nsubs) usage ;; - --pubhosts) COLLECT=PUBHOSTS; shift; break ;; - --subhosts) COLLECT=SUBHOSTS; shift; break ;; - *) ARGS="$ARGS $1"; shift ;; - esac -done - -if [ -z "$COLLECT" ]; then echo "No --pubhost or --subhost specified"; usage; fi +collect() { eval $COLLECT=\""\$$COLLECT $*"\"; } +COLLECT=ARGS while test $# -gt 0; do case $1 in + --publish|--subscribe|--setup|--control) usage ;; + --npubs) collect $1 $2; NPUBS=$2; shift 2 ;; + --nsubs) collect $1 $2; NSUBS=$2; shift 2 ;; --pubhosts) COLLECT=PUBHOSTS; shift ;; --subhosts) COLLECT=SUBHOSTS; shift ;; - *) eval "$COLLECT=\"\$$COLLECT $1\""; shift ;; + *) collect $1; shift ;; esac done +if [ -z "$PUBHOSTS" ]; then echo "Missing --pubhosts"; usage; fi +if [ -z "$SUBHOSTS" ]; then echo "Missing --subhosts"; usage; fi -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() { @@ -47,6 +38,8 @@ start() { } $PERFTEST --setup -for h in $PUBHOSTS; do start publish $h & done -for h in $SUBHOSTS; do start subscribe $h & done +PUBS=($PUBHOSTS) +for (( i=0 ; i < $NPUBS ; ++i)); do start publish ${PUBS[i % ${#PUBS[*]}]} & done +SUBS=($SUBHOSTS) +for (( i=0 ; i < $NSUBS ; ++i)); do start subscribe ${SUBS[i % ${#SUBS[*]}]} & done $PERFTEST --control |