From e6e38b3e12cbc49a28632aa4984698886c413f05 Mon Sep 17 00:00:00 2001 From: "Hahn Axel (hahn)" <axel.hahn@unibe.ch> Date: Thu, 7 Dec 2023 13:48:53 +0100 Subject: [PATCH] show execution time of running job --- classes/cronlog-renderer.class.php | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/classes/cronlog-renderer.class.php b/classes/cronlog-renderer.class.php index 874ff21..3888200 100644 --- a/classes/cronlog-renderer.class.php +++ b/classes/cronlog-renderer.class.php @@ -209,6 +209,13 @@ class cronlogrenderer extends cronlog{ $bIsRunning=true; $sColStatus.=$this->t('status-running'); } + + // execution time of time of currently running job + $iExectime=$aEntry['SCRIPTEXECTIME'] + ? (int)$aEntry['SCRIPTEXECTIME'] + : date('U')-$aEntry['SCRIPTSTARTTIME'] + ; + // render table of last logfile per cron job $sHtml.='<tr onclick="showFile(\''.$aEntry['logfile'].'\');" title="'.sprintf($this->t('row-click-show-logfile'), $aEntry['logfile']).'"' .($bIsRunning ? ' class="message-running"' : '') @@ -218,11 +225,12 @@ class cronlogrenderer extends cronlog{ . '<td>'.$aEntry['SCRIPTLABEL'].'</td>' . '<td>'.$aEntry['server'].'</td>' . '<td' - .($aEntry['SCRIPTEXECTIME']>$this->_iMinTime4Timeline ? ' class="message-warning"' : '' ) + .((int)$aEntry['SCRIPTEXECTIME']>$this->_iMinTime4Timeline ? ' class="message-warning"' : '' ) . '>' .'<span style="display: none">'.str_pad((int)$aEntry['SCRIPTEXECTIME'], 6, '0', STR_PAD_LEFT).'</span>' - .(int)$aEntry['SCRIPTEXECTIME'].'s' - .((int)$aEntry['SCRIPTEXECTIME']>100 ? ' ('.round((int)$aEntry['SCRIPTEXECTIME']/60).'min)' : '') + + .$iExectime.'s' + .($iExectime>100 ? ' ('.round($iExectime/60).'min)' : '') .'</td>' . '<td' .($aEntry['SCRIPTTTL']<$this->_iMinTtl ? ' class="message-warning" title="(using minimal TTL = '.$this->_iMinTtl.' min)"' : '') -- GitLab