diff options
| author | Alan Conway <aconway@apache.org> | 2011-11-08 14:41:51 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2011-11-08 14:41:51 +0000 |
| commit | 9ada72335dbd95a9916f31a168754bfab0a7625c (patch) | |
| tree | 18722da713380336ba37492e1efbf634edee6595 /qpid/cpp/src/tests/qpid-cpp-benchmark | |
| parent | 0b1f6cbb66c19a7bd620e24d1a7e5dff284518cf (diff) | |
| download | qpid-python-9ada72335dbd95a9916f31a168754bfab0a7625c.tar.gz | |
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.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1199266 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src/tests/qpid-cpp-benchmark')
| -rwxr-xr-x | qpid/cpp/src/tests/qpid-cpp-benchmark | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/qpid/cpp/src/tests/qpid-cpp-benchmark b/qpid/cpp/src/tests/qpid-cpp-benchmark index 9a0ee6b384..5dde7958d6 100755 --- a/qpid/cpp/src/tests/qpid-cpp-benchmark +++ b/qpid/cpp/src/tests/qpid-cpp-benchmark @@ -73,6 +73,8 @@ op.add_option("--group-receivers", default=False, action="store_true", 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. |
