summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-05 21:21:28 +0000
committerAlan Conway <aconway@apache.org>2008-09-05 21:21:28 +0000
commitdf334f0768c628f2fed8dd350c135d914c54b918 (patch)
tree82ce5bada942661dbc7fe5333ec38f70379fb57a /cpp/src
parentf09e63101fdf71a796d3e8eb874f94a16541352e (diff)
downloadqpid-python-df334f0768c628f2fed8dd350c135d914c54b918.tar.gz
Fixes to distributed test scripts.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692556 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src')
-rwxr-xr-xcpp/src/tests/benchmark17
-rwxr-xr-xcpp/src/tests/perfdist9
2 files changed, 16 insertions, 10 deletions
diff --git a/cpp/src/tests/benchmark b/cpp/src/tests/benchmark
index 5381fd69fa..d0ad698f9f 100755
--- a/cpp/src/tests/benchmark
+++ b/cpp/src/tests/benchmark
@@ -31,11 +31,13 @@ EOF
}
# Defaults
TESTDIR=${TESTDIR:-$PWD} # Absolute path to test exes on all hosts.
-SCRIPTDIR=${SCRIPTDIR:-$PWD/`dirname $0`} # Absolute path to test scripts on all hosts.
+SCRIPTDIR=${SCRIPTDIR:-`dirname $0`} # Path to local test scripts directory.
SAMPLES=10 # Runs of each test.
COUNT=${COUNT:-10000} # Count for pub/sub tests.
SIZE=${SIZE:-600} # Size of messages
ECHO=${ECHO:-1000} # Count for echo test.
+NSUBS=${NSUBS:-4}
+NPUBS=${NPUBS:-4}
collect() { eval $COLLECT=\""\$$COLLECT $*"\"; }
COLLECT=ARGS
@@ -44,8 +46,10 @@ while test $# -gt 0; do
--testdir) TESTDIR=$2 ; shift 2 ;;
--samples) SAMPLES=$2 ; shift 2 ;;
--count) COUNT=$2 ; shift 2 ;;
- --echos) ECHO==$2 ; shift 2 ;;
- --size) SIZE==$2 ; shift 2 ;;
+ --echos) ECHO=$2 ; shift 2 ;;
+ --size) SIZE=$2 ; shift 2 ;;
+ --nsubs) NSUBS=$2 ; shift 2 ;;
+ --npubs) NPUBS=$2 ; shift 2 ;;
--) COLLECT=CLIENTARG; shift ;;
---) COLLECT=BROKERARG; shift;;
*) collect $1; shift ;;
@@ -74,10 +78,11 @@ dosamples() {
} | tee $FILE
}
+echo "benchmark $*" | tee benchmark.tab
HEADING="pub sub total Mb"
-dosamples $SCRIPTDIR/perfdist --count $COUNT --nsubs 2 --npubs 2 --qt 2 -s -- ${CLIENTS[*]} --- ${BROKERS[*]}
+dosamples $SCRIPTDIR/perfdist --size $SIZE --count $COUNT --nsubs $NSUBS --npubs $NPUBS -s -- ${CLIENTS[*]} --- ${BROKERS[*]}
HEADING="pub"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 --count $COUNT -s -b ${BROKERS[0]}
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 --size $SIZE --count $COUNT -s -b ${BROKERS[0]}
HEADING="sub"
dosamples ssh -A ${CLIENTS[0]} $TESTDIR/consume --queue perftest0 -s --count $COUNT -b ${BROKERS[0]}
HEADING="min max avg"
@@ -86,4 +91,4 @@ dosamples ssh -A ${CLIENTS[0]} $TESTDIR/echotest --count $ECHO -s -b ${BROKERS[0
echo
echo "Tab separated spreadsheet (also stored in benchmark.tab):"
echo
-paste $FILES | tee benchmark.tab
+paste $FILES | tee -a benchmark.tab
diff --git a/cpp/src/tests/perfdist b/cpp/src/tests/perfdist
index 9ba92310a9..4edd9fa6ad 100755
--- a/cpp/src/tests/perfdist
+++ b/cpp/src/tests/perfdist
@@ -55,11 +55,12 @@ start() {
CLIENT=${CLIENTS[i % ${#CLIENTS[*]}]}
BROKER=${BROKERS[i % ${#BROKERS[*]}]}
ARGS="$* --broker $BROKER"
- test -z "$QUIET" && echo "Client $i on $CLIENT: $ARGS"
- ssh -fT $CLIENT $PERFTEST "$@"
+ cmd="ssh -n $CLIENT $PERFTEST $ARGS"
+ test -z "$QUIET" && echo "Client $i: $cmd"
+ $cmd &
}
-$PERFTEST --setup
+$PERFTEST --setup -b ${BROKERS[0]}
for (( i=0 ; i < $NPUBS ; ++i)); do start --publish; done
for (( ; i < $NPUBS+$NSUBS ; ++i)); do start --subscribe; done
-$PERFTEST --control
+$PERFTEST --control -b ${BROKERS[0]}