diff options
author | Alan Conway <aconway@apache.org> | 2008-08-26 22:40:05 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2008-08-26 22:40:05 +0000 |
commit | 29c3598e6d8e5ee8d49f43b65cb99086667612d5 (patch) | |
tree | 0284ed8d6c207292889f5ffd6b62b1560b46a8af | |
parent | eeb3180c4c2e7a200e959e54f5e20ed6df26439e (diff) | |
download | qpid-python-29c3598e6d8e5ee8d49f43b65cb99086667612d5.tar.gz |
echotest: tab separated.
benchmark: runs a set of tests & generates a tab-separated spreadsheet.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@689274 13f79535-47bb-0310-9956-ffa450edef68
-rwxr-xr-x | qpid/cpp/src/tests/benchmark | 43 | ||||
-rw-r--r-- | qpid/cpp/src/tests/echotest.cpp | 2 |
2 files changed, 44 insertions, 1 deletions
diff --git a/qpid/cpp/src/tests/benchmark b/qpid/cpp/src/tests/benchmark new file mode 100755 index 0000000000..8669b28d7b --- /dev/null +++ b/qpid/cpp/src/tests/benchmark @@ -0,0 +1,43 @@ +#!/bin/sh +# A basic "benchmark" to generate performacne samples of throughput and latency. +# Must be run in the qpid src/tests build directory. +# +SAMPLES=${SAMPLES:-10} +CLIENTS=${CLIENTS:-mrg8} # Client hosts +CLIENTS=($CLIENTS) # Array +COUNT=${COUNT:-10000} +ECHO=${ECHO:-100} +BROKER=${BROKER:-mrg7} + +srcdir=`dirname $0` +ADDPATH=$PWD:$PWD/../../../src/tests +PATH=$ADDPATH:$PATH + +trap "rm -f $FILES" EXIT + +dosamples() { + FILE=`mktemp` + FILES="$FILES $FILE" + TABS=`echo "$HEADING" | sed s'/[^ ]//g'` + { + echo "\"$*\"$TABS" + echo "$HEADING" + for (( i=0; i<$SAMPLES; ++i)) ; do echo "`$@`" ; done + echo + } | tee $FILE +} + +HEADING="pub sub total Mb" +dosamples perfdist -b $BROKER --count $COUNT -s -- ${CLIENTS[*]} +HEADING="pub" +dosamples ssh ${CLIENTS[0]} $PWD/publish --routing-key perftest0 -s -b $BROKER --count $COUNT +HEADING="sub" +dosamples ssh ${CLIENTS[0]} $PWD/consume --queue perftest0 -s -b $BROKER --count $COUNT +HEADING="min max avg" +dosamples echotest --count $ECHO -s +HEADING="pub sub total Mb" +dosamples perfdist -b $BROKER --count $COUNT --nsubs 2 --npubs 2 --qt 2 -s -- ${CLIENTS[*]} +echo +echo "Tab separated spreadsheet:" +echo +paste $FILES | tee benchmark.tab diff --git a/qpid/cpp/src/tests/echotest.cpp b/qpid/cpp/src/tests/echotest.cpp index e3157303bd..a57e2de5ad 100644 --- a/qpid/cpp/src/tests/echotest.cpp +++ b/qpid/cpp/src/tests/echotest.cpp @@ -119,7 +119,7 @@ void Listener::received(Message& response) async(session).messageTransfer(arg::content=request); } else { subscriptions.cancel(queue); - if (summary) cout << min << " " << max << " " << total/limit << endl; + if (summary) cout << min << "\t" << max << "\t" << total/limit << endl; else cout << "min: " << min << " max: " << max << " average: " << total/limit << endl; } } |