qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject svn commit: r1174930 - in /qpid/branches/qpid-2920-active/qpid/cpp/src: ./ qpid/cluster/exp/ tests/
Date Fri, 23 Sep 2011 18:10:27 GMT
Author: aconway
Date: Fri Sep 23 18:10:26 2011
New Revision: 1174930

URL: http://svn.apache.org/viewvc?rev=1174930&view=rev
Log:
QPID-2920: Make consume-lock timeout configurable

- Configurable cluster-lock timeout.
- Tweaked qpid-cluster-benchmark default settings.

Added:
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp   (with props)
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h   (with props)
Modified:
    qpid/branches/qpid-2920-active/qpid/cpp/src/cluster.mk
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/BrokerContext.cpp
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Cluster2Plugin.cpp
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.cpp
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.h
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.cpp
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.h
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.cpp
    qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.h
    qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cluster-benchmark
    qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark
    qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-receive.cpp

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/cluster.mk
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/cluster.mk?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/cluster.mk (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/cluster.mk Fri Sep 23 18:10:26 2011
@@ -132,6 +132,8 @@ cluster2_la_SOURCES =				\
 	qpid/cluster/exp/QueueHandler.h		\
 	qpid/cluster/exp/QueueReplica.cpp	\
 	qpid/cluster/exp/QueueReplica.h		\
+	qpid/cluster/exp/Settings.cpp		\
+	qpid/cluster/exp/Settings.h		\
 	qpid/cluster/exp/WiringHandler.cpp	\
 	qpid/cluster/exp/WiringHandler.h
 

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/BrokerContext.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/BrokerContext.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/BrokerContext.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/BrokerContext.cpp Fri Sep
23 18:10:26 2011
@@ -130,7 +130,7 @@ void BrokerContext::create(broker::Queue
     if (tssNoReplicate) return;
     assert(!QueueContext::get(q));
     boost::intrusive_ptr<QueueContext> context(
-        new QueueContext(q, core.getMulticaster()));
+        new QueueContext(q, core.getSettings().getConsumeLock(), core.getMulticaster()));
     std::string data(q.encodedSize(), '\0');
     framing::Buffer buf(&data[0], data.size());
     q.encode(buf);

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Cluster2Plugin.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Cluster2Plugin.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Cluster2Plugin.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Cluster2Plugin.cpp Fri Sep
23 18:10:26 2011
@@ -31,15 +31,16 @@ using broker::Broker;
  */
 struct Cluster2Plugin : public Plugin {
     struct Opts : public Options {
-        Core::Settings& settings;
-        Opts(Core::Settings& s) : Options("Cluster Options"), settings(s) {
+        Settings& settings;
+        Opts(Settings& s) : Options("Cluster Options"), settings(s) {
             addOptions()
-                ("cluster2-name", optValue(settings.name, "NAME"), "Name of cluster to join");
-            // TODO aconway 2010-10-19: copy across other options from ClusterPlugin.h
+                ("cluster2-name", optValue(settings.name, "NAME"), "Name of cluster to join")
+                ("consume-lock", optValue(settings.consumeLockMicros, "uS"), "Maximum time
a broker can hold the consume lock on a shared queue, in microseconds.");
+                // TODO aconway 2010-10-19: copy across other options from ClusterPlugin.h
         }
     };
 
-    Core::Settings settings;
+    Settings settings;
     Opts options;
     Core* core;                 // Core deletes itself on shutdown.
 

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.cpp Fri Sep 23 18:10:26
2011
@@ -39,10 +39,11 @@ namespace cluster {
 Core::Core(const Settings& s, broker::Broker& b) :
     broker(b),
     eventHandler(new EventHandler(*this)),
-    multicaster(eventHandler->getCpg(), b.getPoller(), boost::bind(&Core::fatal, this))
+    multicaster(eventHandler->getCpg(), b.getPoller(), boost::bind(&Core::fatal, this)),
+    settings(s)
 {
     boost::intrusive_ptr<QueueHandler> queueHandler(
-        new QueueHandler(*eventHandler, multicaster));
+        new QueueHandler(*eventHandler, multicaster, settings));
     eventHandler->add(queueHandler);
     eventHandler->add(boost::intrusive_ptr<HandlerBase>(
                           new WiringHandler(*eventHandler, queueHandler)));

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.h?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.h (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Core.h Fri Sep 23 18:10:26
2011
@@ -26,9 +26,11 @@
 #include <memory>
 #include "LockedMap.h"
 #include "Multicaster.h"
+#include "Settings.h"
 #include "qpid/cluster/types.h"
 #include "qpid/cluster/Cpg.h"
 #include "qpid/broker/QueuedMessage.h"
+#include "qpid/sys/Time.h"
 
 // TODO aconway 2010-10-19: experimental cluster code.
 
@@ -56,11 +58,6 @@ class BrokerContext;
 class Core
 {
   public:
-    /** Configuration settings */
-    struct Settings {
-        std::string name;
-    };
-
     typedef LockedMap<RoutingId, boost::intrusive_ptr<broker::Message> > RoutingMap;
 
     /** Constructed during Plugin::earlyInitialize() */
@@ -84,12 +81,15 @@ class Core
      * Used to pass messages being routed from BrokerContext to MessageHandler
      */
     RoutingMap& getRoutingMap() { return routingMap; }
+
+    const Settings& getSettings() const { return settings; }
   private:
     broker::Broker& broker;
     std::auto_ptr<EventHandler> eventHandler; // Handles CPG events.
     BrokerContext* brokerHandler; // Handles broker events.
     RoutingMap routingMap;
     Multicaster multicaster;
+    Settings settings;
 };
 }} // namespace qpid::cluster
 

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.cpp Fri Sep
23 18:10:26 2011
@@ -35,11 +35,10 @@
 namespace qpid {
 namespace cluster {
 
-// FIXME aconway 2011-09-16: configurable timeout.
-QueueContext::QueueContext(broker::Queue& q, Multicaster& m)
+QueueContext::QueueContext(broker::Queue& q, sys::Duration consumeLock, Multicaster&
m)
     : timer(boost::bind(&QueueContext::timeout, this),
             q.getBroker()->getTimer(),
-            100*sys::TIME_MSEC),
+            consumeLock),
       queue(q), mcast(m), consumers(0)
 {
     q.setClusterContext(boost::intrusive_ptr<QueueContext>(this));

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.h?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.h (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueContext.h Fri Sep 23
18:10:26 2011
@@ -51,7 +51,7 @@ class Multicaster;
  */
 class QueueContext : public RefCounted {
   public:
-    QueueContext(broker::Queue& q, Multicaster& m);
+    QueueContext(broker::Queue& q, sys::Duration consumeLock, Multicaster& m);
     ~QueueContext();
 
     /** Replica state has changed, called in deliver thread.

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.cpp Fri Sep
23 18:10:26 2011
@@ -33,8 +33,8 @@ namespace qpid {
 namespace cluster {
 
 // FIXME aconway 2011-05-11: make Multicaster+EventHandler available as Group, clean this
up?
-QueueHandler::QueueHandler(EventHandler& eh, Multicaster& m)
-    : HandlerBase(eh), multicaster(m) {}
+QueueHandler::QueueHandler(EventHandler& eh, Multicaster& m, const Settings&
s)
+    : HandlerBase(eh), multicaster(m),  consumeLock(s.getConsumeLock()) {}
 
 bool QueueHandler::invoke(const framing::AMQBody& body) {
     return framing::invoke(*this, body).wasHandled();
@@ -64,7 +64,7 @@ void QueueHandler::add(boost::shared_ptr
 
     // Local queues already have a context, remote queues need one.
     if (!QueueContext::get(*q))
-        new QueueContext(*q, multicaster); // Context attaches itself to the Queue
+        new QueueContext(*q, consumeLock, multicaster); // Context attaches itself to the
Queue
     // FIXME aconway 2011-09-15: thread safety: called from wiring handler..
     queues[q->getName()] = boost::intrusive_ptr<QueueReplica>(
         new QueueReplica(q, self()));

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.h?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.h (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/QueueHandler.h Fri Sep 23
18:10:26 2011
@@ -24,6 +24,7 @@
 
 #include "HandlerBase.h"
 #include "LockedMap.h"
+#include "Settings.h"
 #include "qpid/framing/AMQP_AllOperations.h"
 #include "boost/shared_ptr.hpp"
 #include "boost/intrusive_ptr.hpp"
@@ -53,7 +54,7 @@ class QueueHandler : public framing::AMQ
                      public HandlerBase
 {
   public:
-    QueueHandler(EventHandler&, Multicaster&);
+    QueueHandler(EventHandler&, Multicaster&, const Settings&);
 
     bool invoke(const framing::AMQBody& body);
 
@@ -76,6 +77,7 @@ class QueueHandler : public framing::AMQ
 
     QueueMap queues;
     Multicaster& multicaster;
+    sys::Duration consumeLock;
 };
 }} // namespace qpid::cluster
 

Added: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp?rev=1174930&view=auto
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp (added)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp Fri Sep 23 18:10:26
2011
@@ -0,0 +1,31 @@
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include "Settings.h"
+
+namespace qpid {
+namespace cluster {
+
+Settings::Settings() :    // Default settings
+    consumeLockMicros(100000)
+{}
+
+}} // namespace qpid::cluster

Propchange: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.cpp
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Added: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h?rev=1174930&view=auto
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h (added)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h Fri Sep 23 18:10:26
2011
@@ -0,0 +1,43 @@
+#ifndef QPID_CLUSTER_EXP_SETTINGS_H
+#define QPID_CLUSTER_EXP_SETTINGS_H
+
+/*
+ *
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ *
+ */
+
+#include <string>
+#include "qpid/sys/Time.h"
+
+// TODO aconway 2010-10-19: experimental cluster code.
+
+namespace qpid {
+namespace cluster {
+
+/** Configuration settings */
+struct Settings {
+    Settings();
+    std::string name;
+    uint32_t consumeLockMicros;
+    sys::Duration getConsumeLock() const { return consumeLockMicros * sys::TIME_USEC; }
+};
+
+}} // namespace qpid::cluster
+
+#endif  /*!QPID_CLUSTER_EXP_SETTINGS_H*/

Propchange: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: qpid/branches/qpid-2920-active/qpid/cpp/src/qpid/cluster/exp/Settings.h
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cluster-benchmark
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cluster-benchmark?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cluster-benchmark (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cluster-benchmark Fri Sep 23 18:10:26
2011
@@ -20,39 +20,33 @@
 
 # Benchmark script for comparing cluster performance.
 
-# Default values
-PORT="5672"
-MESSAGES=10000
-FLOW=100	      # Flow control limit on queue depth for latency.
-REPEAT=10
-QUEUES=4
-CLIENTS=3
+# Default options
+MESSAGES="-m 10000"
+FLOW="--flow-control 100"	      # Flow control limit on queue depth for latency.
+REPEAT="--repeat 10"
+QUEUES="-q 4"
+SENDERS="-s 3"
+RECEIVERS="-r 3"
+BROKERS=			# Local broker
+CLIENT_HOSTS=			# No ssh, all clients are local
 
-while getopts "p:m:f:r:t:b:q:c" opt; do
+while getopts "m:f:n:b:q:s:r:c:" opt; do
     case $opt in
-	p) PORT=$OPTARG;;
-	m) MESSAGES=$OPTARG;;
-	f) FLOW=$OPTARG;;
-	r) REPEAT=$OPTARG;;
-	s) SCALE=$OPTARG;;
-	b) BROKERS=$OPTARG;;
-	q) QUEUES=$OPTARG;;
-	c) CLIENTS=$OPTARG;;
+	m) MESSAGES="-m $OPTARG";;
+	f) FLOW="--flow-control $OPTARG";;
+	n) REPEAT="--repeat $OPTARG";;
+	b) BROKERS="-b $OPTARG";;
+	q) QUEUES="-q $OPTARG";;
+	s) SENDERS="-s $OPTARG";;
+	r) RECEIVERS="-r $OPTARG";;
+	c) CLIENT_HOSTS="-c $OPTARG";;
 	*) echo "Unknown option"; exit 1;;
     esac
 done
 
-BROKERS=${BROKERS:-$(echo $HOSTS | sed "s/\>/:$PORT/g;s/ /,/g")} # Broker URL list
-BROKER=`echo $BROKERS | awk -F, '{print $1}'` # First broker
-
 run_test() { echo $*; shift; "$@"; echo; echo; echo; }
 
-# Multiple pubs/subs connect via multiple brokers (active-active)
-run_test "multi-host-thruput" qpid-cpp-benchmark --repeat $REPEAT -b $BROKERS --no-timestamp
--summarize -q$QUEUES -s$CLIENTS -r$CLIENTS -m $MESSAGES
-
-# Multiple pubs/subs connect via single broker (active-passive)
-run_test "single-host-thruput" qpid-cpp-benchmark --repeat $REPEAT -b $BROKER --no-timestamp
--summarize -q$QUEUES -s$CLIENTS -r$CLIENTS -m $MESSAGES
+run_test "Throughput:" qpid-cpp-benchmark $REPEAT $BROKERS --summarize $QUEUES $SENDERS $RECEIVERS
$MESSAGES $CLIENT_HOSTS
 
-# Latency
-run_test "latency" qpid-cpp-benchmark --repeat $REPEAT -b $BROKER --connection-options '{tcp-nodelay:true}'
-m $MESSAGES --flow-control $FLOW
+run_test "Latency:" qpid-cpp-benchmark $REPEAT $BROKERS --connection-options "{tcp-nodelay:true}"
$MESSAGES $FLOW $CLIENT_HOSTS
 

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-cpp-benchmark Fri Sep 23 18:10:26
2011
@@ -115,9 +115,7 @@ def start_receive(queue, index, opts, re
     if opts.connection_options:
         command += ["--connection-options",opts.connection_options]
     if host: command = ssh_command(host, command)
-    # FIXME aconway 2011-09-15: 
-    # return clients.add(Popen(command, stdout=PIPE, stderr=PIPE))
-    return clients.add(Popen(command, stdout=PIPE))
+    return clients.add(Popen(command, stdout=PIPE, stderr=PIPE))
 
 def start_send(queue, opts, broker, host):
     address="%s;{%s}"%(queue,",".join(opts.send_option + ["create:always"]))
@@ -130,9 +128,7 @@ def start_send(queue, opts, broker, host
                "--report-total",
                "--report-header=no",
                "--timestamp=%s"%(opts.timestamp and "yes" or "no"),
-               # FIXME aconway 2011-09-15: 
-               # "--sequence=no",
-               "--sequence=yes",
+               "--sequence=no",
                "--flow-control", str(opts.flow_control),
                "--durable", str(opts.durable)
                ]

Modified: qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-receive.cpp
URL: http://svn.apache.org/viewvc/qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-receive.cpp?rev=1174930&r1=1174929&r2=1174930&view=diff
==============================================================================
--- qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-receive.cpp (original)
+++ qpid/branches/qpid-2920-active/qpid/cpp/src/tests/qpid-receive.cpp Fri Sep 23 18:10:26
2011
@@ -190,24 +190,13 @@ int main(int argc, char ** argv)
                 session.createSender(opts.readyAddress).send(msg);
 
             // For receive rate calculation
-            qpid::sys::AbsTime start; // Will be set on first itertion.
-            bool started=false;
+            qpid::sys::AbsTime start(qpid::sys::now());
             int64_t interval = 0;
             if (opts.receiveRate) interval = qpid::sys::TIME_SEC/opts.receiveRate;
 
             std::map<std::string,Sender> replyTo;
 
             while (!done && receiver.fetch(msg, timeout)) {
-                // FIXME aconway 2011-09-19: 
-//                 std::ostringstream os;
-//                 os << "qpid-receive(" << getpid() << ") seq=" <<
msg.getProperties()[SN] << endl; // FIXME aconway 2011-09-19:
-//                 cerr << os.str() << flush;
-                if (!started) {
-                    // Start the time on receipt of the first message to avoid counting
-                    // idle time at process startup.
-                    start = qpid::sys::AbsTime::now();
-                    started = true;
-                }
                 reporter.message(msg);
                 if (!opts.ignoreDuplicates || !sequenceTracker.isDuplicate(msg)) {
                     if (msg.getContent() == EOS) {



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


Mime
View raw message