qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From g...@apache.org
Subject svn commit: r1486666 - /qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp
Date Mon, 27 May 2013 17:06:13 GMT
Author: gsim
Date: Mon May 27 17:06:13 2013
New Revision: 1486666

URL: http://svn.apache.org/r1486666
Log:
NO-JIRA: match the frequency of rate failure warnings to stats report frequency

Modified:
    qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp

Modified: qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp?rev=1486666&r1=1486665&r2=1486666&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp (original)
+++ qpid/trunk/qpid/cpp/src/tests/qpid-latency-test.cpp Mon May 27 17:06:13 2013
@@ -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;
         }



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org


Mime
View raw message