summaryrefslogtreecommitdiff
path: root/qpid/cpp/src
diff options
context:
space:
mode:
authorGordon Sim <gsim@apache.org>2013-05-27 17:06:13 +0000
committerGordon Sim <gsim@apache.org>2013-05-27 17:06:13 +0000
commitdd58e721c757b00871c3eebf1e79875311e6978a (patch)
tree903fed527a68f146eeac81721238fdb56f0c02a2 /qpid/cpp/src
parent322b2650808bb2489baadc35dcbb68bc3d8e7dad (diff)
downloadqpid-python-dd58e721c757b00871c3eebf1e79875311e6978a.tar.gz
NO-JIRA: match the frequency of rate failure warnings to stats report frequency
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk@1486666 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/cpp/src')
-rw-r--r--qpid/cpp/src/tests/qpid-latency-test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/qpid/cpp/src/tests/qpid-latency-test.cpp b/qpid/cpp/src/tests/qpid-latency-test.cpp
index 2343cb1d77..ba53ba0459 100644
--- a/qpid/cpp/src/tests/qpid-latency-test.cpp
+++ b/qpid/cpp/src/tests/qpid-latency-test.cpp
@@ -368,13 +368,15 @@ void Sender::sendByRate()
async(session).messageTransfer(arg::content=msg, arg::acceptMode=1);
if (opts.sync) session.sync();
++sent;
- if (Duration(last, sentAt) > TIME_SEC*2) {
+ if (Duration(last, sentAt) > (opts.reportFrequency*TIME_MSEC)) {
Duration t(start, now());
//check rate actually achieved thus far
- uint actualRate = sent / (t/TIME_SEC);
- //report inability to stay within 1% of desired rate
- if (actualRate < opts.rate && opts.rate - actualRate > opts.rate/100) {
- std::cerr << "WARNING: Desired send rate: " << opts.rate << ", actual send rate: " << actualRate << std::endl;
+ if (t/TIME_SEC) {
+ uint actualRate = sent / (t/TIME_SEC);
+ //report inability to stay within 1% of desired rate
+ if (actualRate < opts.rate && opts.rate - actualRate > opts.rate/100) {
+ std::cerr << "WARNING: Desired send rate: " << opts.rate << ", actual send rate: " << actualRate << std::endl;
+ }
}
last = sentAt;
}