summaryrefslogtreecommitdiff
path: root/qpid/cpp/src/tests/perfdist
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2007-11-08 21:16:02 +0000
committerAlan Conway <aconway@apache.org>2007-11-08 21:16:02 +0000
commit59c875183c8c4aad0bd7424b2742770a7c675db5 (patch)
tree282366d751db82cc091f1a82991173af32fba571 /qpid/cpp/src/tests/perfdist
parenta967a3375df7ccc7fbbe09af5e86f01914431394 (diff)
downloadqpid-python-59c875183c8c4aad0bd7424b2742770a7c675db5.tar.gz
src/tests/perfdist: Use ssh to run distributed perftest.
./perfdist for usage. src/tests/perftest.cpp: --summary gives one-line report, can cut/paste into spreadsheet for multiple runs. --purge as initial clean-up step for distributed tests (see perfdist) git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@593321 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/perfdist')
-rwxr-xr-xqpid/cpp/src/tests/perfdist33
1 files changed, 33 insertions, 0 deletions
diff --git a/qpid/cpp/src/tests/perfdist b/qpid/cpp/src/tests/perfdist
new file mode 100755
index 0000000000..07338f6822
--- /dev/null
+++ b/qpid/cpp/src/tests/perfdist
@@ -0,0 +1,33 @@
+#!/bin/bash
+#
+echo $_
+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.
+EOF
+exit 1
+}
+
+while test "$HOSTS" != "$*"; do
+ case $1 in
+ --consumers|--publish|--listen) usage ;;
+ --) shift; PUB="$1" ; shift ; HOSTS="$*" ;;
+ *) 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&
+done
+wait
+