Return-Path: Delivered-To: apmail-qpid-commits-archive@www.apache.org Received: (qmail 78108 invoked from network); 14 Feb 2011 20:08:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 14 Feb 2011 20:08:23 -0000 Received: (qmail 99639 invoked by uid 500); 14 Feb 2011 20:08:23 -0000 Delivered-To: apmail-qpid-commits-archive@qpid.apache.org Received: (qmail 99588 invoked by uid 500); 14 Feb 2011 20:08:23 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 99581 invoked by uid 99); 14 Feb 2011 20:08:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 20:08:23 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=5.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.4] (HELO eris.apache.org) (140.211.11.4) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 14 Feb 2011 20:08:21 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id AC3872388903; Mon, 14 Feb 2011 20:07:59 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r1070634 - /qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark Date: Mon, 14 Feb 2011 20:07:59 -0000 To: commits@qpid.apache.org From: aconway@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20110214200759.AC3872388903@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: aconway Date: Mon Feb 14 20:07:59 2011 New Revision: 1070634 URL: http://svn.apache.org/viewvc?rev=1070634&view=rev Log: No JIRA: Added --durable option to qpid-cp-benchmark Modified: qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark 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=1070634&r1=1070633&r2=1070634&view=diff ============================================================================== --- qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark (original) +++ qpid/trunk/qpid/cpp/src/tests/qpid-cpp-benchmark Mon Feb 14 20:07:59 2011 @@ -65,6 +65,8 @@ op.add_option("--connection-options", ty help="Connection options for senders & receivers") op.add_option("--flow-control", default=0, type="int", metavar="N", help="Flow control each sender to limit queue depth to 2*N. 0 means no flow control.") +op.add_option("--durable", default=False, action="store_true", + help="Use durable queues and messages") single_quote_re = re.compile("'") def posix_quote(string): @@ -76,7 +78,9 @@ def ssh_command(host, command): return ["ssh", host] + [posix_quote(arg) for arg in command] def start_receive(queue, index, opts, ready_queue, broker, host): - address="%s;{%s}"%(queue,",".join(["create:always"]+opts.receive_option)) + address_opts=["create:receiver"] + opts.receive_option + if opts.durable: address_opts += ["node:{durable:true}"] + address="%s;{%s}"%(queue,",".join(address_opts)) msg_total=opts.senders*opts.messages messages = msg_total/opts.receivers; if (index < msg_total%opts.receivers): messages += 1 @@ -111,7 +115,8 @@ def start_send(queue, opts, broker, host "--report-header=no", "--timestamp=%s"%(opts.timestamp and "yes" or "no"), "--sequence=no", - "--flow-control", str(opts.flow_control) + "--flow-control", str(opts.flow_control), + "--durable", str(opts.durable) ] command += opts.send_arg if opts.connection_options: @@ -140,12 +145,12 @@ def print_header(timestamp): def parse(parser, lines): # Parse sender/receiver output for l in lines: fn_val = zip(parser, l) - + return [map(lambda p: p[0](p[1]), zip(parser,line.split())) for line in lines] def parse_senders(senders): return parse([int],[first_line(p) for p in senders]) - + def parse_receivers(receivers): return parse([int,float,float,float],[first_line(p) for p in receivers if p]) @@ -168,7 +173,7 @@ def print_summary(send_stats, recv_stats l_avg = sum(l[3] for l in recv_stats)/len(recv_stats) summary += "\t%.2f\t%.2f\t%.2f"%(l_min, l_max, l_avg) print summary - + class ReadyReceiver: """A receiver for ready messages""" @@ -177,7 +182,7 @@ class ReadyReceiver: self.connection = qpid.messaging.Connection(broker) self.connection.open() self.receiver = self.connection.session().receiver( - "%s;{create:always,delete:always}"%(queue)) + "%s;{create:receiver,delete:receiver,node:{durable:false}}"%(queue)) self.receiver.session.sync() self.timeout=2 --------------------------------------------------------------------- Apache Qpid - AMQP Messaging Implementation Project: http://qpid.apache.org Use/Interact: mailto:commits-subscribe@qpid.apache.org