Author: aconway
Date: Tue Aug 26 15:40:05 2008
New Revision: 689274

URL: http://svn.apache.org/viewvc?rev=689274&view=rev
Log:
echotest: tab separated.
benchmark: runs a set of tests & generates a tab-separated spreadsheet.

Added:
    incubator/qpid/trunk/qpid/cpp/src/tests/benchmark   (with props)
Modified:
    incubator/qpid/trunk/qpid/cpp/src/tests/echotest.cpp

Added: incubator/qpid/trunk/qpid/cpp/src/tests/benchmark
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/benchmark?rev=689274&view=auto
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/benchmark (added)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/benchmark Tue Aug 26 15:40:05 2008
@@ -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 "[EMAIL PROTECTED]" ; 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

Propchange: incubator/qpid/trunk/qpid/cpp/src/tests/benchmark
------------------------------------------------------------------------------
    svn:executable = *

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/echotest.cpp
URL: 
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/echotest.cpp?rev=689274&r1=689273&r2=689274&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/echotest.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/echotest.cpp Tue Aug 26 15:40:05 
2008
@@ -119,7 +119,7 @@
         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;
     }
 }


Reply via email to