From 5c61d725e15c2d3d60b19ad8471f11901a065450 Mon Sep 17 00:00:00 2001 From: Eric Espie Date: Wed, 19 Jul 2023 15:06:00 +0200 Subject: [PATCH] =?UTF-8?q?N=C2=B06436=20-=20Integrate=20Performance=20Aud?= =?UTF-8?q?it=20pre=20requisite=20in=20iTop=20Pro=202.7.9=20(changed=20con?= =?UTF-8?q?fig=20variable=20name)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/config.class.inc.php | 6 +++--- core/kpi.class.inc.php | 12 ++++++------ core/metamodel.class.php | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/core/config.class.inc.php b/core/config.class.inc.php index 3d23ed24b..edf47c74a 100644 --- a/core/config.class.inc.php +++ b/core/config.class.inc.php @@ -963,10 +963,10 @@ class Config 'source_of_value' => '', 'show_in_conf_sample' => false, ), - 'log_kpi_report_to_extensions_only' => array( + 'log_generate_legacy_kpi_report' => array( 'type' => 'bool', - 'description' => 'Report only the KPI logging extensions', - 'default' => false, + 'description' => 'Generate the legacy KPI report (kpi.html)', + 'default' => true, 'value' => '', 'source_of_value' => '', 'show_in_conf_sample' => false, diff --git a/core/kpi.class.inc.php b/core/kpi.class.inc.php index 592f2b276..90b0e741d 100644 --- a/core/kpi.class.inc.php +++ b/core/kpi.class.inc.php @@ -32,7 +32,7 @@ class ExecutionKPI static protected $m_bEnabled_Memory = false; static protected $m_bBlameCaller = false; static protected $m_sAllowedUser = '*'; - static protected $m_bReportExtensionsOnly = false; + static protected $m_bGenerateLegacyReport = true; static protected $m_fSlowQueries = 0; static protected $m_aStats = array(); // Recurrent operations @@ -81,9 +81,9 @@ class ExecutionKPI return false; } - static public function SetReportExtensionsOnly($bReportExtensionsOnly) + static public function SetGenerateLegacyReport($bReportExtensionsOnly) { - self::$m_bReportExtensionsOnly = $bReportExtensionsOnly; + self::$m_bGenerateLegacyReport = $bReportExtensionsOnly; } static public function SetSlowQueries($fSlowQueries) @@ -140,7 +140,7 @@ class ExecutionKPI } } - if (self::$m_bReportExtensionsOnly) { + if (!self::$m_bGenerateLegacyReport) { return; } @@ -397,7 +397,7 @@ class ExecutionKPI } } - if (!is_null($aNewEntry) && !self::$m_bReportExtensionsOnly) + if (!is_null($aNewEntry) && self::$m_bGenerateLegacyReport) { self::$m_aExecData[] = $aNewEntry; } @@ -426,7 +426,7 @@ class ExecutionKPI $fStopped = MyHelpers::getmicrotime(); $fDuration = $fStopped - $this->m_fStarted; $aCallstack = []; - if (!self::$m_bReportExtensionsOnly) { + if (self::$m_bGenerateLegacyReport) { if (self::$m_bBlameCaller) { $aCallstack = MyHelpers::get_callstack(1); self::$m_aStats[$sOperation][$sArguments][] = [ diff --git a/core/metamodel.class.php b/core/metamodel.class.php index 9af5005e8..baa35122c 100644 --- a/core/metamodel.class.php +++ b/core/metamodel.class.php @@ -6349,7 +6349,7 @@ abstract class MetaModel ExecutionKPI::EnableDuration(self::$m_oConfig->Get('log_kpi_duration')); ExecutionKPI::EnableMemory(self::$m_oConfig->Get('log_kpi_memory')); ExecutionKPI::SetAllowedUser(self::$m_oConfig->Get('log_kpi_user_id')); - ExecutionKPI::SetReportExtensionsOnly(self::$m_oConfig->Get('log_kpi_report_to_extensions_only')); + ExecutionKPI::SetGenerateLegacyReport(self::$m_oConfig->Get('log_generate_legacy_kpi_report')); ExecutionKPI::SetSlowQueries(self::$m_oConfig->Get('log_kpi_slow_queries')); self::$m_bSkipCheckToWrite = self::$m_oConfig->Get('skip_check_to_write');