diff --git a/core/kpi.class.inc.php b/core/kpi.class.inc.php index a6efd775c..33e3cbed1 100644 --- a/core/kpi.class.inc.php +++ b/core/kpi.class.inc.php @@ -1,29 +1,14 @@ +/** + * @copyright Copyright (C) 2010-2023 Combodo SARL + * @license http://opensource.org/licenses/AGPL-3.0 + */ use Combodo\iTop\Core\Kpi\KpiLogData; use Combodo\iTop\Service\Module\ModuleService; /** * Measures operations duration, memory usage, etc. (and some other KPIs) - * - * @copyright Copyright (C) 2010-2021 Combodo SARL - * @license http://opensource.org/licenses/AGPL-3.0 */ class ExecutionKPI @@ -355,6 +340,10 @@ class ExecutionKPI { global $fItopStarted; + if (!self::IsEnabled()) { + return; + } + $aNewEntry = null; $fStarted = $this->m_fStarted; @@ -417,6 +406,10 @@ class ExecutionKPI public function ComputeStatsForExtension($object, $sMethod) { + if (!self::IsEnabled()) { + return; + } + $sSignature = ModuleService::GetInstance()->GetModuleMethodSignature($object, $sMethod); if (utils::StartsWith($sSignature, '[')) { $this->ComputeStats('Extension', $sSignature); @@ -425,6 +418,10 @@ class ExecutionKPI public function ComputeStats($sOperation, $sArguments) { + if (!self::IsEnabled()) { + return; + } + $fDuration = 0; if (self::$m_bEnabled_Duration) { $fStopped = MyHelpers::getmicrotime();