qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r692478 - in /incubator/qpid/trunk/qpid/cpp/src: qpid/client/SubscriptionManager.cpp qpid/client/SubscriptionManager.h tests/benchmark tests/perfdist tests/start_cluster_hosts
Date Fri, 05 Sep 2008 16:30:03 GMT
Author: aconway
Date: Fri Sep  5 09:30:03 2008
New Revision: 692478

URL: http://svn.apache.org/viewvc?rev=692478&view=rev
Log:
src/qpid/client/SubscriptionManager.cpp: added start().
src/tests* improvements to multi-host test scripts.

Modified:
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.cpp
    incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.h
    incubator/qpid/trunk/qpid/cpp/src/tests/benchmark
    incubator/qpid/trunk/qpid/cpp/src/tests/perfdist
    incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster_hosts

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.cpp?rev=692478&r1=692477&r2=692478&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.cpp (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.cpp Fri Sep  5 09:30:03
2008
@@ -124,6 +124,12 @@
     dispatcher.run();
 }
 
+void SubscriptionManager::start()
+{
+    dispatcher.setAutoStop(autoStop);
+    dispatcher.start();
+}
+
 void SubscriptionManager::stop()
 {
     dispatcher.stop();

Modified: incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.h
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.h?rev=692478&r1=692477&r2=692478&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.h (original)
+++ incubator/qpid/trunk/qpid/cpp/src/qpid/client/SubscriptionManager.h Fri Sep  5 09:30:03
2008
@@ -134,16 +134,25 @@
     /** Cancel a subscription. */
     void cancel(const std::string tag);
 
-    /** Deliver messages until stop() is called. */
+    /** Deliver messages in the current thread until stop() is called.
+     * Only one thread may be running in a SubscriptionManager at a time.
+     * @see run
+     */
     void run();
 
+    /** Start a new thread to deliver messages.
+     * Only one thread may be running in a SubscriptionManager at a time.
+     * @see start
+     */
+    void start();
+    
     /** If set true, run() will stop when all subscriptions
      * are cancelled. If false, run will only stop when stop()
      * is called. True by default.
      */
     void setAutoStop(bool set=true);
 
-    /** Cause run() to return */
+    /** Stop delivery. Causes run() to return, or the thread started with start() to exit.
*/
     void stop();
 
     static const uint32_t UNLIMITED=0xFFFFFFFF;

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/benchmark
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/benchmark?rev=692478&r1=692477&r2=692478&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/benchmark (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/benchmark Fri Sep  5 09:30:03 2008
@@ -17,20 +17,37 @@
 # specific language governing permissions and limitations
 # under the License.
 #
-# A basic "benchmark" to generate performacne samples of throughput and latency.
+# A basic "benchmark" to generate performacne samples of throughput
+# and latency against a single cluster member while they are replicating.
+#
 # 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
+#
+
+# 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=
+
+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" ;;
+    esac
+done
 
+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; } 
+
+export TESTDIR			# For perfdist
+CLIENTS=($CLIENTS)		# Convert to array
 trap "rm -f $FILES" EXIT
 
 dosamples() {
@@ -40,22 +57,21 @@
     {
 	echo "\"$*\"$TABS"
 	echo "$HEADING" 
-	for (( i=0; i<$SAMPLES; ++i)) ; do echo "`$@`" ; done
+	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[*]}
+dosamples $SCRIPTDIR/perfdist $BROKER_FLAGS --count $COUNT --nsubs 2 --npubs 2 --qt 2 -s
-- ${CLIENTS[*]}
 HEADING="pub"
-dosamples ssh ${CLIENTS[0]} $PWD/publish --routing-key perftest0 -s -b $BROKER --count $COUNT
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/publish --routing-key perftest0 -s $BROKER_FLAGS
--count $COUNT
 HEADING="sub"
-dosamples ssh ${CLIENTS[0]} $PWD/consume --queue perftest0 -s -b $BROKER --count $COUNT
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/consume --queue perftest0 -s $BROKER_FLAGS --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[*]}
+dosamples ssh -A ${CLIENTS[0]} $TESTDIR/echotest --count $ECHO -s
+
 echo
-echo "Tab separated spreadsheet:"
+echo "Tab separated spreadsheet (also stored in benchmark.tab):"
 echo
 paste $FILES | tee benchmark.tab

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/perfdist
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/perfdist?rev=692478&r1=692477&r2=692478&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/perfdist (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/perfdist Fri Sep  5 09:30:03 2008
@@ -12,7 +12,7 @@
 Run perftest with clients running on the listed hosts.  Clients are
 assigned to hosts publishers first, then subscribers the host list is
 used round-robin if there are more clients than hosts. perftest-args should
-include a --host <brokerhost>  flag.
+include a --host <brokerhost>  flag (and --port if necessary).
 
 Do not pass preftest action flags: --setup, --control, --publish, --subscribe.
 The script will pass them to the appropriate client processes.
@@ -24,6 +24,8 @@
 exit 1
 }
 
+TESTDIR=${TESTDIR:-$PWD}	# Absolute path to test exes on all hosts.
+
 collect() { eval $COLLECT=\""\$$COLLECT $*"\"; }
 NPUBS=1
 NSUBS=1
@@ -40,10 +42,7 @@
 done
 
 if [ -z "$HOSTS" ]; then usage "No hosts listed after --"; fi
-ADDPATH="$PWD"
-PATH=$ADDPATH:$PATH
-which perftest>/dev/null || exit 1
-PERFTEST="perftest $ARGS"
+PERFTEST="$TESTDIR/perftest $ARGS"
 
 HOSTS=($HOSTS)
 start() {

Modified: incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster_hosts
URL: http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster_hosts?rev=692478&r1=692477&r2=692478&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster_hosts (original)
+++ incubator/qpid/trunk/qpid/cpp/src/tests/start_cluster_hosts Fri Sep  5 09:30:03 2008
@@ -6,36 +6,45 @@
 # Arguments: [-k] [-p port] HOST [HOST...]
 #  -p port to start broker on, can be 0. Actual ports recorded in cluster.addr.
 #  -k kill any qpidd processes owned by this user before starting.
-# Start a broker on each named host. Name a host twice to start multiple brokers.
 #
-# You must be able to ssh to each host and have primary group ais.
-# qpidd must exist in the same directory `pwd`/.. as on this host.
+# Start a broker on each named host. Name a host twice to start multiple brokers.
 #
+# You must be able to ssh to each host and be in group ais.
+# $QPIDD must be executable on each host.
+# Logs go to syslog on each host, with a unique prefix per broker.
+# 
 
-ADDR_FILE=cluster.addr
+QPIDD=${QPIDD:-$PWD/../qpidd}
+LIBQPIDCLUSTER=${LIBQPIDCLUSTER:-$PWD/../.libs/libqpidcluster.so}
+CLUSTER=$USER			# User name is default cluster name.
+RESTART=NO
 
-while getopts "kp:" ARG ; do
+while getopts "kp:c:q:r" ARG ; do
     case $ARG in
-	k) KILL=yes ; rm -f $ADDR_FILE ;;
+	k) KILL=yes ;; 
 	p) PORT="$OPTARG" ;;
+	c) CLUSTER=$OPTARG ;;
+	q) QPIDD=$OPTARG ;;
+	l) LIBQPIDCLUSTER=$OPTARG ;;
+	r) RESTART=yes ;;
 	*) echo "Error parsing options: $ARG"; exit 1 ;;
     esac
 done
 shift `expr $OPTIND - 1`
 test -n "$PORT" && PORTOPT="-p $PORT"
-test -n $KILL && KILL="../qpidd -q $PORTOPT ;"
-
+test "$KILL" = yes && KILL="$QPIDD -q $PORTOPT ;"
 test -z "$*" && { echo Must specify at least one host; exit 1; }
-test -f $ADDR_FILE && { echo "$ADDR_FILE file already exists" ; exit 1; }
-CLUSTER=$USER			# User name is cluster name.
-OPTS="-d $PORTOPT --load-module ../.libs/libqpidcluster.so  --cluster-name=$CLUSTER --no-data-dir
--auth=no --log-output=syslog"
+
+
+OPTS="-d $PORTOPT --load-module $LIBQPIDCLUSTER --cluster-name=$CLUSTER --no-data-dir --auth=no
--log-output=syslog"
 
 num=0
 for h in $*; do
     num=`expr $num + 1`	      # Give a unique log prefix to each node.
-    cmd="cd $PWD; $KILL ../qpidd $OPTS --log-prefix $num.$h"
-    out=`ssh $h "$cmd"` || { echo $out ; exit 1; }
+    cmd="$KILL $QPIDD $OPTS --log-prefix $num.$h"
+    echo == $h
+    out=`echo "$cmd" | ssh $h newgrp ais` || { echo $out ; exit 1; }
     if [ "$PORT" = 0 ] ; then p=$out; else p=$PORT; fi
-    echo "$h $p" | tee -a $ADDR_FILE
+    echo "$h $p" 
 done
 



Mime
View raw message