summaryrefslogtreecommitdiff
path: root/cpp/src/tests/benchmark
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2008-09-05 19:53:44 +0000
committerAlan Conway <aconway@apache.org>2008-09-05 19:53:44 +0000
commit98ec4b4e9226b7d9221dfd5a8eeddd408e3e1caf (patch)
tree9a89658107dd1ecc21ee9cd9a0e979d77d80e7bb /cpp/src/tests/benchmark
parent34048060a1c00291e0d7a56725001deb3100c6e2 (diff)
downloadqpid-python-98ec4b4e9226b7d9221dfd5a8eeddd408e3e1caf.tar.gz
Fixed cluster membership notification.
Cluster events with RefCountedBuffers for queueing. PollableQueue clears bacth immediately. Improved perfdist: clients hit multiple brokers in a cluster. git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@692521 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/benchmark')
-rwxr-xr-xcpp/src/tests/benchmark52
1 files changed, 32 insertions, 20 deletions
diff --git a/cpp/src/tests/benchmark b/cpp/src/tests/benchmark
index 9e8023043b..5381fd69fa 100755
--- a/cpp/src/tests/benchmark
+++ b/cpp/src/tests/benchmark
@@ -21,33 +21,45 @@
# and latency against a single cluster member while they are replicating.
#
# Must be run in the qpid src/tests build directory.
-#
+#
+usage() {
+cat <<EOF
+Usage: $0 [options] -- client hosts --- broker hosts
+Read the script for options.
+EOF
+}
# Defaults
TESTDIR=${TESTDIR:-$PWD} # Absolute path to test exes on all hosts.
-SCRIPTDIR=${SCRIPTDIR:-$PWD/`dirname $0`} # Absolute path to test exes on all hosts.
-SAMPLES=10 # Runs of each test.
-COUNT=${COUNT:-10000} # Count for pub/sub tests.
-ECHO=${ECHO:-1000} # Count for echo test.
-BROKER_FLAGS=
+SCRIPTDIR=${SCRIPTDIR:-$PWD/`dirname $0`} # Absolute path to test scripts on all hosts.
+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.
-while getopts "t:b:p:s:c:n:e" opt ; do
- case $opt in
- t) TESTDIR=$OPTARG ;;
- b) BROKER_FLAGS="$BROKER_FLAGS -b $OPTARG" ;;
- p) BROKER_FLAGS="$BROKER_FLAGS -p $OPTARG" ;;
- s) SAMPLES=$OPTARG ;;
- c) CLIENTS="$CLIENTS $OPTARG" ;;
- n) COUNT="$OPTARG" ;;
- e) ECHO="$OPTARG" ;;
+collect() { eval $COLLECT=\""\$$COLLECT $*"\"; }
+COLLECT=ARGS
+while test $# -gt 0; do
+ case $1 in
+ --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 ;;
+ --) COLLECT=CLIENTARG; shift ;;
+ ---) COLLECT=BROKERARG; shift;;
+ *) collect $1; shift ;;
esac
done
+CLIENTS=${CLIENTARG:-$CLIENTS}
+BROKERS=${BROKERARG:-$BROKERS}
test -z "$CLIENTS" && { echo "Must specify at least one client host."; exit 1; }
-test -z "$BROKER_FLAGS" && { echo "Must specify a broker host."; exit 1; }
+test -z "$BROKERS" && { echo "Must specify at least one broker host."; exit 1; }
export TESTDIR # For perfdist
CLIENTS=($CLIENTS) # Convert to array
+BROKERS=($BROKERS)
trap "rm -f $FILES" EXIT
dosamples() {
@@ -63,13 +75,13 @@ dosamples() {
}
HEADING="pub sub total Mb"
-dosamples $SCRIPTDIR/perfdist $BROKER_FLAGS --count $COUNT --nsubs 2 --npubs 2 --qt 2 -s -- ${CLIENTS[*]}
+dosamples $SCRIPTDIR/perfdist --count $COUNT --nsubs 2 --npubs 2 --qt 2 -s -- ${CLIENTS[*]} --- ${BROKERS[*]}
HEADING="pub"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 -s $BROKER_FLAGS --count $COUNT
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 --count $COUNT -s -b ${BROKERS[0]}
HEADING="sub"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/consume --queue perftest0 -s $BROKER_FLAGS --count $COUNT
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/consume --queue perftest0 -s --count $COUNT -b ${BROKERS[0]}
HEADING="min max avg"
-dosamples ssh -A ${CLIENTS[0]} $TESTDIR/echotest --count $ECHO -s
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/echotest --count $ECHO -s -b ${BROKERS[0]}
echo
echo "Tab separated spreadsheet (also stored in benchmark.tab):"