From ea65746ff26aef93503e6858d27cdb0bb07a75c5 Mon Sep 17 00:00:00 2001 From: Gordon Sim Date: Mon, 27 May 2013 17:06:13 +0000 Subject: 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 --- cpp/src/tests/qpid-latency-test.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'cpp') 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; } -- cgit v1.2.1