summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorKim van der Riet <kpvdr@apache.org>2011-11-16 16:03:28 +0000
committerKim van der Riet <kpvdr@apache.org>2011-11-16 16:03:28 +0000
commit3ef3040ec768200971cfec3913e6646c0d0c6c3e (patch)
treef8ef5b05c2428226bc1bb7689b76143b16f900f2 /qpid/cpp/src
parent41d02e6f0f2c0d1629746e77f54f358e618880a0 (diff)
downloadqpid-python-3ef3040ec768200971cfec3913e6646c0d0c6c3e.tar.gz
QPID-3623, QPID-3624: Fixed transaction accounting, also replaced argparse module with optparse module for use on earlier versions of Python than 2.7. Some minor code tidy-up was also included.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1202755 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/tests/qpid-perftest.cpp15
1 files changed, 9 insertions, 6 deletions
diff --git a/qpid/cpp/src/tests/qpid-perftest.cpp b/qpid/cpp/src/tests/qpid-perftest.cpp
index 664f0cf877..919ab5db4b 100644
--- a/qpid/cpp/src/tests/qpid-perftest.cpp
+++ b/qpid/cpp/src/tests/qpid-perftest.cpp
@@ -424,9 +424,9 @@ struct Controller : public Client {
AbsTime end=now();
double time=secs(start, end);
- if (time <= 0.0) {
- throw Exception("ERROR: Test completed in zero seconds. Try again with a larger message count.");
- }
+ if (time <= 0.0) {
+ throw Exception("ERROR: Test completed in zero seconds. Try again with a larger message count.");
+ }
double txrate=opts.transfers/time;
double mbytes=(txrate*opts.size)/(1024*1024);
@@ -472,10 +472,11 @@ struct Controller : public Client {
struct PublishThread : public Client {
string destination;
string routingKey;
+ size_t pubNum;
- PublishThread() {};
+ PublishThread() : pubNum(0) {};
- PublishThread(string key, string dest=string()) {
+ PublishThread(size_t pubNum, string key, string dest=string()) : pubNum(pubNum) {
destination=dest;
routingKey=key;
}
@@ -533,6 +534,7 @@ struct PublishThread : public Client {
arg::content=msg,
arg::acceptMode=1);
}
+if ((i+1)%100==0) std::cout << pubNum << std::flush;
if (opts.txPub && ((i+1) % opts.txPub == 0)){
if (opts.commitAsync){
session.txCommit();
@@ -630,6 +632,7 @@ struct SubscribeThread : public Client {
size_t expect=0;
for (size_t i = 0; i < opts.subQuota; ++i) {
msg=lq.pop();
+if ((i+1)%100==0) std::cout << "s" << std::flush;
if (opts.txSub && ((i+1) % opts.txSub == 0)) {
if (opts.commitAsync) session.txCommit();
else sync(session).txCommit();
@@ -708,7 +711,7 @@ int main(int argc, char** argv) {
if (opts.publish) {
size_t n = singleProcess ? opts.pubs : 1;
for (size_t j = 0; j < n; ++j) {
- pubs.push_back(new PublishThread(key.str(), exchange));
+ pubs.push_back(new PublishThread(j, key.str(), exchange));
pubs.back().thread=Thread(pubs.back());
}
}