diff --git a/library/Icingadb/Widget/Detail/CheckStatistics.php b/library/Icingadb/Widget/Detail/CheckStatistics.php index 64fef3922..b69b4bdb8 100644 --- a/library/Icingadb/Widget/Detail/CheckStatistics.php +++ b/library/Icingadb/Widget/Detail/CheckStatistics.php @@ -122,6 +122,8 @@ protected function assembleBody(BaseHtmlElement $body) // The only way to detect this, is to measure how old the last update is. $nextCheckTime = null; $leftNow = 0; + } elseif ($nextCheckTime - $lastUpdateTime <= 0) { + $leftNow = 0; } else { $leftNow = 100 * (1 - ($nextCheckTime - time()) / ($nextCheckTime - $lastUpdateTime)); if ($leftNow > 100) { @@ -133,7 +135,7 @@ protected function assembleBody(BaseHtmlElement $body) $styleElement->addFor($progressBar, ['width' => sprintf('%F%%', $leftNow)]); - $leftExecutionEnd = $nextCheckTime !== null ? $durationScale * ( + $leftExecutionEnd = $nextCheckTime !== null && $nextCheckTime - $lastUpdateTime > 0 ? $durationScale * ( 1 - ($nextCheckTime - $executionEndTime) / ($nextCheckTime - $lastUpdateTime) ) : 0;