qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From astitc...@apache.org
Subject svn commit: r801858 - /qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
Date Fri, 07 Aug 2009 01:53:39 GMT
Author: astitcher
Date: Fri Aug  7 01:53:39 2009
New Revision: 801858

URL: http://svn.apache.org/viewvc?rev=801858&view=rev
Log:
Further improve the delay/overrun Timer warnings when both occur at once

Modified:
    qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp

Modified: qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp?rev=801858&r1=801857&r2=801858&view=diff
==============================================================================
--- qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp (original)
+++ qpid/trunk/qpid/cpp/src/qpid/sys/Timer.cpp Fri Aug  7 01:53:39 2009
@@ -99,12 +99,12 @@
 
             // warn on extreme lateness
             AbsTime start(AbsTime::now());
-            Duration late(t->sortTime, start);
+            Duration delay(t->sortTime, start);
             {
             ScopedLock<Mutex> l(t->callbackLock);
             if (t->cancelled) {
-                if (late > 500 * TIME_MSEC) {
-                    QPID_LOG(debug, "cancelled Timer woken up late by " << late / TIME_MSEC
<< "ms");
+                if (delay > 500 * TIME_MSEC) {
+                    QPID_LOG(debug, "cancelled Timer woken up " << delay / TIME_MSEC
<< "ms late");
                 }
                 continue;
             } else if(Duration(t->nextFireTime, start) >= 0) {
@@ -113,9 +113,17 @@
                 // Warn on callback overrun
                 AbsTime end(AbsTime::now());
                 Duration overrun(tasks.top()->nextFireTime, end);
-                if (late > 1 * TIME_MSEC) {
-                    QPID_LOG(warning, "Timer woken up late by " << late / TIME_MSEC
<< "ms");
-                } else if (overrun > 1 * TIME_MSEC) {
+                bool late = delay > 1 * TIME_MSEC;
+                bool overran = overrun > 1 * TIME_MSEC;
+                if (late)
+                if (overran) {
+                    QPID_LOG(warning,
+                        "Timer woken up " << delay / TIME_MSEC << "ms late, "
+                        "overrunning by " << overrun / TIME_MSEC << "ms [taking
"
+                        << Duration(start, end) << "]");
+                } else {
+                    QPID_LOG(warning, "Timer woken up " << delay / TIME_MSEC <<
"ms late");
+                } else if (overran) {
                     QPID_LOG(warning,
                         "Timer callback overran by " << overrun / TIME_MSEC <<
"ms [taking "
                         << Duration(start, end) << "]");



---------------------------------------------------------------------
Apache Qpid - AMQP Messaging Implementation
Project:      http://qpid.apache.org
Use/Interact: mailto:commits-subscribe@qpid.apache.org


Mime
View raw message