qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1199266 - in /qpid/trunk/qpid/cpp/src/tests: qpid-cluster-benchmark qpid-cpp-benchmark
Date Tue, 08 Nov 2011 14:41:52 GMT
Author: aconway
Date: Tue Nov  8 14:41:51 2011
New Revision: 1199266

URL: http://svn.apache.org/viewvc?rev=1199266&view=rev
Log:
NO-JIRA: add --no-delete option to qpid-cpp-benchmark and qpid-cluster-benchmark.

Don't delete test queues between runs so that pre-configured queues can
be used by the test.

Modified:
    qpid/trunk/qpid/cpp/src/tests/qpid-cluster-benchmark
    qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark

Modified: qpid/trunk/qpid/cpp/src/tests/qpid-cluster-benchmark
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-cluster-benchmark?rev=1199266&r1=1199265&r2=1199266&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-cluster-benchmark (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-cluster-benchmark Tue Nov  8 14:41:51 2011
@@ -30,7 +30,7 @@ RECEIVERS="-r 3"
 BROKERS=			# Local broker
 CLIENT_HOSTS=			# No ssh, all clients are local
 
-while getopts "m:f:n:b:q:s:r:c:x:t" opt; do
+while getopts "m:f:n:b:q:s:r:c:txy" opt; do
     case $opt in
 	m) MESSAGES="-m $OPTARG";;
 	f) FLOW="--flow-control $OPTARG";;
@@ -40,15 +40,16 @@ while getopts "m:f:n:b:q:s:r:c:x:t" opt;
 	s) SENDERS="-s $OPTARG";;
 	r) RECEIVERS="-r $OPTARG";;
 	c) CLIENT_HOSTS="-c $OPTARG";;
-	x) SAVE_RECEIVED="--save-received";;
 	t) TCP_NODELAY="--connection-options {tcp-nodelay:true}";;
+	x) SAVE_RECEIVED="--save-received";;
+	y) NO_DELETE="--no-delete";;
 	*) echo "Unknown option"; exit 1;;
     esac
 done
 BROKER=$(echo $BROKERS | sed s/,.*//)
 run_test() { echo $*; shift; "$@"; echo; echo; echo; }
 
-OPTS="$REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS $MESSAGES $CLIENT_HOSTS $SAVE_RECEIVED
$TCP_NODELAY"
+OPTS="$REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS $MESSAGES $CLIENT_HOSTS $SAVE_RECEIVED
$TCP_NODELAY $NO_DELETE"
 run_test "Queue contention:" qpid-cpp-benchmark $OPTS
 run_test "No queue contention: :" qpid-cpp-benchmark $OPTS --group-receivers
 

Modified: qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark?rev=1199266&r1=1199265&r2=1199266&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark Tue Nov  8 14:41:51 2011
@@ -73,6 +73,8 @@ op.add_option("--group-receivers", defau
               help="Run receivers for the same queue on the same host.")
 op.add_option("--verbose", default=False, action="store_true",
               help="Show commands executed")
+op.add_option("--no-delete", default=False, action="store_true",
+              help="Don't delete the test queues.")
 single_quote_re = re.compile("'")
 def posix_quote(string):
     """ Quote a string for use as an argument in a posix shell"""
@@ -174,16 +176,17 @@ def queue_exists(queue,broker):
             return False
     finally: c.close()
 
-def recreate_queues(queues, brokers):
+def recreate_queues(queues, brokers, no_delete):
     c = qpid.messaging.Connection(brokers[0])
     c.open()
     s = c.session()
     for q in queues:
-        try: s.sender("%s;{delete:always}"%(q)).close()
-        except qpid.messaging.exceptions.NotFound: pass
-        # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate
-        for b in brokers:
-            while queue_exists(q,b): time.sleep(0.1);
+        if not no_delete:
+            try: s.sender("%s;{delete:always}"%(q)).close()
+            except qpid.messaging.exceptions.NotFound: pass
+            # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate
+            for b in brokers:
+                while queue_exists(q,b): time.sleep(0.1);
         s.sender("%s;{create:always}"%q)
         # FIXME aconway 2011-05-04: new cluster async wiring, wait for changes to propagate
         for b in brokers:
@@ -282,7 +285,7 @@ def main():
     queues = ["%s-%s"%(opts.queue_name, i) for i in xrange(opts.queues)]
     try:
         for i in xrange(opts.repeat):
-            recreate_queues(queues, opts.broker)
+            recreate_queues(queues, opts.broker, opts.no_delete)
             ready_receiver = ReadyReceiver(ready_queue, opts.broker[0])
 
             if opts.group_receivers: # Run receivers for same queue against same broker.



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message