diff options
author | Alan Conway <aconway@apache.org> | 2007-12-13 20:39:28 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2007-12-13 20:39:28 +0000 |
commit | 0d3521880f6c98ef529b78786cc561a2ae18bb12 (patch) | |
tree | 427557eb23dd57710fd91644587e02e3c6fdb9b1 /cpp/src/tests/perftest.cpp | |
parent | 290f052bdcfa112292c891dc4f179e20bf06c812 (diff) | |
download | qpid-python-0d3521880f6c98ef529b78786cc561a2ae18bb12.tar.gz |
perftest:
- changed default message size to 1024
- made --pub-confirm=true the default for accurate publish rates.
- added Mbytes/sec rate to results
perfdist: takes a single host list for publishr and subscriber clients.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk/qpid@604022 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/perftest.cpp')
-rw-r--r-- | cpp/src/tests/perftest.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/cpp/src/tests/perftest.cpp b/cpp/src/tests/perftest.cpp index bf6b0fe4d5..8ba0f21fc5 100644 --- a/cpp/src/tests/perftest.cpp +++ b/cpp/src/tests/perftest.cpp @@ -89,7 +89,7 @@ struct Opts : public TestOptions { Opts() : TestOptions(helpText), setup(false), control(false), publish(false), subscribe(false), - pubs(1), count(500000), size(64), confirm(false), durable(false), + pubs(1), count(500000), size(1024), confirm(true), durable(false), subs(1), ack(0), qt(1), mode(SHARED), summary(false) { @@ -107,7 +107,7 @@ struct Opts : public TestOptions { ("npubs", optValue(pubs, "N"), "Create N publishers.") ("count", optValue(count, "N"), "Each publisher sends N messages.") ("size", optValue(size, "BYTES"), "Size of messages in bytes.") - ("pub-confirm", optValue(confirm), "Publisher use confirm-mode.") + ("pub-confirm", optValue(confirm, "yes|no"), "Publisher use confirm-mode.") ("durable", optValue(durable, "yes|no"), "Publish messages as durable.") ("nsubs", optValue(subs, "N"), "Create N subscribers.") @@ -115,7 +115,7 @@ struct Opts : public TestOptions { "N==0: Subscriber uses unconfirmed mode") ("qt", optValue(qt, "N"), "Create N queues or topics.") - ("summary,s", optValue(summary), "Summary output only."); + ("summary,s", optValue(summary), "Summary output: pubs/sec subs/sec transfers/sec Mbytes/sec"); } // Computed values @@ -315,20 +315,26 @@ struct Controller : public Client { process(opts.totalSubs, "sub_done", boost::ref(subRates)); AbsTime end=now(); double time=secs(start, end); - + double txrate=opts.transfers/time; + double mbytes=(txrate*opts.size)/(1024*1024); + if (!opts.summary) { - cout << endl << "Publish rates: " << endl; + cout << endl << "Total " << opts.transfers << " transfers of " + << opts.size << " bytes in " + << time << " seconds." << endl; + cout << endl << "Publish transfers/sec: " << endl; pubRates.print(cout); - cout << endl << "Subscribe rates: " << endl; + cout << endl << "Subscribe transfers/sec: " << endl; subRates.print(cout); - cout << endl << "Total transfers: " << opts.transfers << endl; - cout << "Total time (secs): " << time << endl; - cout << "Total rate: " << opts.transfers/time << endl; + cout << endl + << "Total transfers/sec: " << txrate << endl + << "Total Mbytes/sec: " << mbytes << endl; } else { cout << pubRates.mean() << "\t" << subRates.mean() << "\t" - << opts.transfers/time << endl; + << txrate << "\t" + << mbytes << endl; } } catch (const std::exception& e) { |