diff --git a/core/kpi.class.inc.php b/core/kpi.class.inc.php index fd6f83feb..977b3da44 100644 --- a/core/kpi.class.inc.php +++ b/core/kpi.class.inc.php @@ -1,18 +1,20 @@ 0) { @@ -71,6 +76,7 @@ class ExecutionKPI return true; } } + return false; } @@ -97,7 +103,7 @@ class ExecutionKPI $sFor = self::$m_sAllowedUser == '*' ? 'EVERYBODY' : "'".trim(self::$m_sAllowedUser)."'"; $sSlowQueries = ''; if (self::$m_fSlowQueries > 0) { - $sSlowQueries = ". Slow Queries: ".self::$m_fSlowQueries."s"; + $sSlowQueries = '. Slow Queries: '.self::$m_fSlowQueries.'s'; } $aExtensions = []; @@ -127,7 +133,7 @@ class ExecutionKPI $sRequest .= ' operation: '.$_POST['operation']; } - $fStop = MyHelpers::getmicrotime(); + $fStop = microtime(true); if (($fStop - $fItopStarted) > self::$m_fSlowQueries) { // Invoke extensions to log the KPI operation /** @var \iKPILoggerExtension $oExtensionInstance */ @@ -151,17 +157,17 @@ class ExecutionKPI $sTableStyle = 'background-color: #ccc; margin: 10px;'; - $sHtml = "
'.$oStarted->format('Y-m-d H:i:s.u').'
'; - $sHtml .= "log_kpi_user_id: ".UserRights::GetUserId()."
"; - $sHtml .= "log_kpi_user_id: '.UserRights::GetUserId().'
'; + $sHtml .= '| Operation | Begin | End | Duration | Memory start | Memory end | Memory peak | "; - $sHtml .= ""; + $sHtml .= ''; + $sHtml .= 'Operation | Begin | End | Duration | Memory start | Memory end | Memory peak | '; + $sHtml .= ''; foreach (self::$m_aExecData as $aOpStats) { $sOperation = $aOpStats['op']; $sBegin = round($aOpStats['time_begin'], 3); @@ -180,12 +186,12 @@ class ExecutionKPI } } - $sHtml .= "
|---|---|---|---|---|---|---|
| $sOperation | $sBegin | $sEnd | $sDuration | $sMemBegin | $sMemEnd | $sMemPeak | "; - $sHtml .= "
| Operation | Count | Duration | Min | Max | Avg | "; - $sHtml .= ""; + $sHtml .= ''; + $sHtml .= 'Operation | Count | Duration | Min | Max | Avg | '; + $sHtml .= ''; foreach ($aConsolidatedStats as $sOperation => $aOpStats) { $sOperation = ''.$sOperation.''; $sCount = $aOpStats['count']; @@ -230,14 +236,14 @@ class ExecutionKPI $sMax = ''.round($aOpStats['max'], 3).''; $sAvg = round($aOpStats['avg'], 3); - $sHtml .= "
|---|---|---|---|---|---|
| $sOperation | $sCount | $sDuration | $sMin | $sMax | $sAvg | "; - $sHtml .= "
| Operation details (+ blame caller if log_kpi_duration = 2) | Count | Duration | Min | Max | "; - $sHtml .= ""; + $sHtml .= ''; + $sHtml .= 'Operation details (+ blame caller if log_kpi_duration = 2) | Count | Duration | Min | Max | '; + $sHtml .= ''; $bDisplayHeader = false; } - $sHtml .= "
|---|---|---|---|---|
| $sHtmlArguments | $iCountInter | $sTotalInter | $sMinInter | $sMaxInter | "; - $sHtml .= "