diff options
| author | Gordon Sim <gsim@apache.org> | 2009-06-23 10:03:37 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2009-06-23 10:03:37 +0000 |
| commit | 8e8e9924bf8a59c39e0de3aa5928cd8730874fcd (patch) | |
| tree | 5042a5d7784a9e98c6b6e8427be203bfdc364e06 /cpp/src/tests/cluster_test_scripts/perftest | |
| parent | e885a92dccf2b18744af1210138c12ca7bc7ff97 (diff) | |
| download | qpid-python-8e8e9924bf8a59c39e0de3aa5928cd8730874fcd.tar.gz | |
Renamed new directory to avoid clashing with executable name where build is done in source tree.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@787618 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/cluster_test_scripts/perftest')
| -rwxr-xr-x | cpp/src/tests/cluster_test_scripts/perftest | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/cpp/src/tests/cluster_test_scripts/perftest b/cpp/src/tests/cluster_test_scripts/perftest new file mode 100755 index 0000000000..72c8268835 --- /dev/null +++ b/cpp/src/tests/cluster_test_scripts/perftest @@ -0,0 +1,34 @@ +#!/bin/sh +# Run a distributed perftest against a cluster. +# Args: npubs nsubs [perftest-options] + +source config.sh + +NPUBS=${1:-4} ; shift +NSUBS=${1:-4} ; shift +OPTS="--npubs $NPUBS --nsubs $NSUBS $*" + +CLIENTS=($CLIENT_HOSTS) +BROKERS=(`cat $CLUSTER_HOME/hosts`) +PORTS=(`cat $CLUSTER_HOME/ports`) + +start() { + client=${CLIENTS[i % ${#CLIENTS[*]}]} + broker=${BROKERS[i % ${#BROKERS[*]}]} + port=${PORTS[i % ${#PORTS[*]}]} + ssh -n $client $PERFTEST $OPTS $* -b $broker -p $port & + PIDS="$PIDS $!" +} + +ssh ${CLIENTS[0]} $PERFTEST $OPTS --setup -b ${BROKERS[0]} -p${PORTS[0]} +for (( i=0 ; i < $NPUBS ; ++i)); do start --publish; done +for (( ; i < $NPUBS+$NSUBS ; ++i)); do start --subscribe; done +ssh ${CLIENTS[0]} $PERFTEST $OPTS --control -b ${BROKERS[0]} -p${PORTS[0]} + +for pid in $PIDS; do + wait $pid || echo "ERROR: client process $pid failed" +done + +`dirname $0`/cluster_check + + |
