From d3040cc26fd7e7fab93bf0cca99d71dabe1f4885 Mon Sep 17 00:00:00 2001
From: Jan David Mol <mol@astron.nl>
Date: Thu, 7 Sep 2017 08:20:23 +0000
Subject: [PATCH] Task #11122: Do not print average runtime if timer did not
 run

---
 RTCP/Cobalt/CoInterface/src/BudgetTimer.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc b/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
index 89ba3fa92e1..f2772ca9e95 100644
--- a/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
+++ b/RTCP/Cobalt/CoInterface/src/BudgetTimer.cc
@@ -45,7 +45,9 @@ namespace LOFAR {
         const double realTimePerc = 100.0 * getAverage() / budget;
 
         if (log_on_destruction) {
-          if (realTimePerc >= 100.0) {
+          if (getCount() == 0) {
+            LOG_DEBUG_STR(std::left << std::setw(25) << itsName << ": did not run");
+          } else if (realTimePerc >= 100.0) {
             LOG_ERROR_STR(std::left << std::setw(25) << itsName << ": ran at " << realTimePerc << "% of run-time budget");
           } else {
             LOG_INFO_STR(std::left << std::setw(25) << itsName << ": ran at " << realTimePerc << "% of run-time budget");
-- 
GitLab