summaryrefslogtreecommitdiff
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
commitea65746ff26aef93503e6858d27cdb0bb07a75c5 (patch)
treef8a37e3bafe2477a7abd80415bbda556d20736a5
parent39e542f1dacc880d6aa4901d7269ff365c8d76b3 (diff)
downloadqpid-python-ea65746ff26aef93503e6858d27cdb0bb07a75c5.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/qpid@1486666 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--cpp/src/tests/qpid-latency-test.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/cpp/src/tests/qpid-latency-test.cpp b/cpp/src/tests/qpid-latency-test.cpp
index 2343cb1d77..ba53ba0459 100644
--- a/cpp/src/tests/qpid-latency-test.cpp
+++ b/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;
}