diff options
| author | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2006-11-29 14:36:08 +0000 |
| commit | 3bb9f37e40cb72d88cf6885bc80f93da3c3231ed (patch) | |
| tree | 6d1cc162a39c183ecfea71181a7dbb0449542bff /qpid/cpp/test/client/topic_publisher.cpp | |
| parent | 89589a150ca7a9c8166ca86af30bbe1159bc0405 (diff) | |
| download | qpid-python-3bb9f37e40cb72d88cf6885bc80f93da3c3231ed.tar.gz | |
Posix EventChannel implementation using epoll. Placeholder for kevents.
Dynamic thread pool EventChannelThreads to serve EventChannel.
Misc cleanup/enhancements.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@480582 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/test/client/topic_publisher.cpp')
| -rw-r--r-- | qpid/cpp/test/client/topic_publisher.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/test/client/topic_publisher.cpp b/qpid/cpp/test/client/topic_publisher.cpp index d9f271e2f0..97d589c1d1 100644 --- a/qpid/cpp/test/client/topic_publisher.cpp +++ b/qpid/cpp/test/client/topic_publisher.cpp @@ -114,11 +114,13 @@ int main(int argc, char** argv){ int64_t sum(0); for(int i = 0; i < batchSize; i++){ if(i > 0 && args.getDelay()) sleep(args.getDelay()); - int64_t time = publisher.publish(args.getMessages(), args.getSubscribers(), args.getSize()); + Time time = publisher.publish( + args.getMessages(), args.getSubscribers(), args.getSize()); if(!max || time > max) max = time; if(!min || time < min) min = time; sum += time; - std::cout << "Completed " << (i+1) << " of " << batchSize << " in " << time << "ms" << std::endl; + std::cout << "Completed " << (i+1) << " of " << batchSize + << " in " << time/TIME_MSEC << "ms" << std::endl; } publisher.terminate(); int64_t avg = sum / batchSize; @@ -129,7 +131,7 @@ int main(int argc, char** argv){ channel.close(); connection.close(); }catch(qpid::QpidError error){ - std::cout << "Error [" << error.code << "] " << error.msg << " (" << error.file << ":" << error.line << ")" << std::endl; + std::cout << error.what() << std::endl; } } } @@ -153,7 +155,7 @@ void Publisher::waitForCompletion(int msgs){ int64_t Publisher::publish(int msgs, int listeners, int size){ Message msg; msg.setData(generateData(size)); - int64_t start = Time::now().msecs(); + Time start = now(); { Monitor::ScopedLock l(monitor); for(int i = 0; i < msgs; i++){ @@ -170,7 +172,7 @@ int64_t Publisher::publish(int msgs, int listeners, int size){ waitForCompletion(listeners); } - int64_t finish(Time::now().msecs()); + Time finish = now(); return finish - start; } |
