You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by gs...@apache.org on 2009/02/18 19:17:08 UTC

svn commit: r745590 - /qpid/trunk/qpid/cpp/src/tests/perftest.cpp

Author: gsim
Date: Wed Feb 18 18:17:08 2009
New Revision: 745590

URL: http://svn.apache.org/viewvc?rev=745590&view=rev
Log:
Fixed for cases where --subs > 1 and --iterations > 1


Modified:
    qpid/trunk/qpid/cpp/src/tests/perftest.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/perftest.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/perftest.cpp?rev=745590&r1=745589&r2=745590&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/perftest.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/perftest.cpp Wed Feb 18 18:17:08 2009
@@ -259,6 +259,7 @@
         queueInit("pub_done");
         queueInit("sub_ready");
         queueInit("sub_done");
+        if (opts.iterations > 1) queueInit("sub_iteration");
         if (opts.mode==SHARED) {
             framing::FieldTable settings;//queue policy settings
             settings.setInt("qpid.max_count", opts.queueMaxCount);
@@ -397,6 +398,9 @@
             for (size_t j = 0; j < opts.iterations; ++j) {
                 AbsTime start=now();
                 send(opts.totalPubs, "pub_start", "start"); // Start publishers
+                if (j) {
+                    send(opts.totalPubs, "sub_iteration", "next"); // Start subscribers on next iteration
+                }
 
                 Stats pubRates;
                 Stats subRates;
@@ -585,10 +589,19 @@
                 if (opts.commitAsync) session.txCommit();
                 else sync(session).txCommit();
             }
+
+            LocalQueue iterationControl;
+            if (opts.iterations > 1) {
+                subs.subscribe(iterationControl, "sub_iteration", SubscriptionSettings(FlowControl::messageCredit(0)));
+            }
             
             for (size_t j = 0; j < opts.iterations; ++j) {
                 if (j > 0) {
-                    //need to allocate some more credit
+                    //need to wait here until all subs are done
+                    session.messageFlow("sub_iteration", 0, 1); 
+                    iterationControl.pop();
+
+                    //need to allocate some more credit for subscription
                     session.messageFlow(queue, 0, opts.subQuota); 
                 }
                 Message msg;



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