summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2011-11-08 14:41:51 +0000
committerAlan Conway <aconway@apache.org>2011-11-08 14:41:51 +0000
commit9ada72335dbd95a9916f31a168754bfab0a7625c (patch)
tree18722da713380336ba37492e1efbf634edee6595
parent0b1f6cbb66c19a7bd620e24d1a7e5dff284518cf (diff)
downloadqpid-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
-rwxr-xr-xqpid/cpp/src/tests/qpid-cluster-benchmark7
-rwxr-xr-xqpid/cpp/src/tests/qpid-cpp-benchmark17
2 files changed, 14 insertions, 10 deletions
diff --git a/qpid/cpp/src/tests/qpid-cluster-benchmark b/qpid/cpp/src/tests/qpid-cluster-benchmark
index 4d6eaba223..a5076799f6 100755
--- a/qpid/cpp/src/tests/qpid-cluster-benchmark
+++ b/qpid/cpp/src/tests/qpid-cluster-benchmark
@@ -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; do
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
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.