From 831edb0cb38965f03507ccb89bf0b2d098382446 Mon Sep 17 00:00:00 2001 From: Rajith Muditha Attapattu Date: Wed, 20 Jul 2011 20:46:49 +0000 Subject: QPID-3358 Added a controller to coordinate tests run on several jvm's on the same host or multiple host machines. 1. The controller registers participants and waits until the desired numbers of producers and consumers join the test. 2. It then coordinates warmup runs between the participants and starts the actual test run. 3. Once the test is done it collects stats and computes averages,max,minetc.. and prints them out. The collector is designed run by itself, but can be run inline with a producer for simplicity. Infact by default the producer will run a controller unless -Dext_controller=true is specified. This is done to ensure that the simple test cases like the per-report script can be run without additional configuration. The code would need a bit of cleanup later on. The current form was done quite quickly as a POC for an urgent task. I will be reviewing the code and making improvements over the comming days. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@1148935 13f79535-47bb-0310-9956-ffa450edef68 --- java/tools/bin/perf-report | 37 +++++++++++++++++++------------------ 1 file changed, 19 insertions(+), 18 deletions(-) (limited to 'java/tools/bin') diff --git a/java/tools/bin/perf-report b/java/tools/bin/perf-report index 228f792a52..7de3f2b602 100755 --- a/java/tools/bin/perf-report +++ b/java/tools/bin/perf-report @@ -21,16 +21,16 @@ # This will run the following test cases defined below and produce # a report in tabular format. -SUB_MEM=-Xmx1024M -PUB_MEM=-Xmx1024M QUEUE="queue;{create:always,node:{x-declare:{auto-delete:true}}}" DURA_QUEUE="dqueue;{create:always,node:{durable:true,x-declare:{auto-delete:true}}}" TOPIC="amq.topic/test" DURA_TOPIC="amq.topic/test;{create:always,link:{durable:true}}" +COMMON_CONFIG="-server -Durl=amqp://guest:guest@clientid/testpath?brokerlist='tcp://localhost:5672'" + waitfor() { until grep -a -l "$2" $1 >/dev/null 2>&1 ; do sleep 1 ; done ; } cleanup() -{ +{ pids=`ps aux | grep java | grep Perf | awk '{print $2}'` if [ "$pids" != "" ]; then kill -3 $pids @@ -42,30 +42,31 @@ cleanup() # $2 consumer options # $3 producer options run_testcase() -{ - sh run-sub $LOG_CONFIG $SUB_MEM $2 > sub.out & - waitfor sub.out "Warming up" - sh run-pub $LOG_CONFIG $PUB_MEM $3 > pub.out & - waitfor sub.out "Completed the test" - waitfor pub.out "Consumer has completed the test" +{ + sh run-sub $COMMON_CONFIG $2 > sub.out & + sh run-pub $COMMON_CONFIG $3 > pub.out & + waitfor pub.out "Controller: Completed the test" sleep 2 #give a grace period to shutdown - print_result $1 + print_result $1 + mv pub.out $1.pub.out + mv sub.out $1.sub.out } print_result() { - prod_rate=`cat pub.out | grep "Producer rate" | awk '{print $3}'` - sys_rate=`cat sub.out | grep "System Throughput" | awk '{print $4}'` - cons_rate=`cat sub.out | grep "Consumer rate" | awk '{print $4}'` - avg_latency=`cat sub.out | grep "Avg Latency" | awk '{print $4}'` - min_latency=`cat sub.out | grep "Min Latency" | awk '{print $4}'` - max_latency=`cat sub.out | grep "Max Latency" | awk '{print $4}'` - - printf "|%-15s|%15.2f|%13.2f|%13.2f|%11.2f|%11d|%11d|\n" $1 $sys_rate $prod_rate $cons_rate $avg_latency $min_latency $max_latency + prod_rate=`cat pub.out | grep "Avg Producer rate" | awk '{print $5}'` + sys_rate=`cat pub.out | grep "System Throughput" | awk '{print $4}'` + cons_rate=`cat pub.out | grep "Avg Consumer rate" | awk '{print $5}'` + avg_latency=`cat pub.out | grep "Avg System Latency" | awk '{print $5}'` + min_latency=`cat pub.out | grep "Min System Latency" | awk '{print $5}'` + max_latency=`cat pub.out | grep "Max System Latency" | awk '{print $5}'` + + printf "|%-15s|%15.2f|%13.2f|%13.2f|%11.2f|%11.2f|%11.2f|\n" $1 $sys_rate $prod_rate $cons_rate $avg_latency $min_latency $max_latency echo "------------------------------------------------------------------------------------------------" } trap cleanup EXIT +rm -rf *.out #cleanup old files. echo "Test report on " `date +%F` echo "================================================================================================" -- cgit v1.2.1