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 2008/07/23 11:09:05 UTC

svn commit: r679038 - /incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp

Author: gsim
Date: Wed Jul 23 02:09:05 2008
New Revision: 679038

URL: http://svn.apache.org/viewvc?rev=679038&view=rev
Log:
Further fixes to transactional perftest:
* correction to transaction boundaries
* ensure any outstanding acks are sent on completion of subscriber


Modified:
    incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp

Modified: incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp?rev=679038&r1=679037&r2=679038&view=diff
==============================================================================
--- incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp (original)
+++ incubator/qpid/branches/qpid.0-10/cpp/src/tests/perftest.cpp Wed Jul 23 02:09:05 2008
@@ -478,7 +478,7 @@
                             arg::content=msg,
                             arg::acceptMode=1);
                     }
-                    if (opts.tx && (i % opts.tx == 0)) sync(session).txCommit();
+                    if (opts.tx && ((i+1) % opts.tx == 0)) sync(session).txCommit();
                     if (opts.intervalPub) ::usleep(opts.intervalPub*1000);
                 }
                 if (opts.confirm) session.sync();
@@ -551,7 +551,7 @@
                 size_t expect=0;
                 for (size_t i = 0; i < opts.subQuota; ++i) {
                     msg=lq.pop();
-                    if (opts.tx && (i % opts.tx == 0)) sync(session).txCommit();
+                    if (opts.tx && ((i+1) % opts.tx == 0)) sync(session).txCommit();
                     if (opts.intervalSub) ::usleep(opts.intervalSub*1000);
                     // TODO aconway 2007-11-23: check message order for. 
                     // multiple publishers. Need an array of counters,
@@ -568,8 +568,8 @@
                         expect = n+1;
                     }
                 }
-                if (opts.ack)
-                    subs.getAckPolicy().ackOutstanding(session); // Cumulative ack for final batch.
+                if (opts.tx || opts.ack)
+                    lq.getAckPolicy().ackOutstanding(session); // Cumulative ack for final batch.
                 if (opts.tx)
                     sync(session).txCommit();
                 AbsTime end=now();