diff options
| author | Gordon Sim <gsim@apache.org> | 2008-07-23 09:09:05 +0000 |
|---|---|---|
| committer | Gordon Sim <gsim@apache.org> | 2008-07-23 09:09:05 +0000 |
| commit | d1481d3ee54ab7f9c62a909a8e904f1b9308f4fc (patch) | |
| tree | e2c27fe5c8bc1cff76b771b8884133a8e4ab98b7 /cpp/src/tests | |
| parent | ae93edc529c252366f1d628ea6d7f28a184e152c (diff) | |
| download | qpid-python-d1481d3ee54ab7f9c62a909a8e904f1b9308f4fc.tar.gz | |
Further fixes to transactional perftest:
* correction to transaction boundaries
* ensure any outstanding acks are sent on completion of subscriber
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/branches/qpid.0-10@679038 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests')
| -rw-r--r-- | cpp/src/tests/perftest.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/cpp/src/tests/perftest.cpp b/cpp/src/tests/perftest.cpp index ee4645658b..b666102e70 100644 --- a/cpp/src/tests/perftest.cpp +++ b/cpp/src/tests/perftest.cpp @@ -478,7 +478,7 @@ struct PublishThread : public Client { 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 @@ struct SubscribeThread : public Client { 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 @@ struct SubscribeThread : public Client { 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(); |
