diff --git a/app/Lib/Tools/BenchmarkTool.php b/app/Lib/Tools/BenchmarkTool.php index 8f741b854..ca2956590 100644 --- a/app/Lib/Tools/BenchmarkTool.php +++ b/app/Lib/Tools/BenchmarkTool.php @@ -15,9 +15,6 @@ class BenchmarkTool /** @var retention */ private $retention = 0; - /** @var start_time */ - public $start_timexxx; - const BENCHMARK_SCOPES = ['user', 'endpoint', 'user_agent']; const BENCHMARK_FIELDS = ['time', 'sql_time', 'sql_queries', 'memory']; const BENCHMARK_UNITS = [ diff --git a/app/Model/Datasource/Database/MysqlExtended.php b/app/Model/Datasource/Database/MysqlExtended.php index 02d486529..32718ed72 100644 --- a/app/Model/Datasource/Database/MysqlExtended.php +++ b/app/Model/Datasource/Database/MysqlExtended.php @@ -152,7 +152,9 @@ class MysqlExtended extends Mysql public function execute($sql, $options = [], $params = []) { $log = $options['log'] ?? $this->fullDebug; - + if (Configure::read('Plugin.Benchmarking_enable')) { + $log = true; + } if ($log) { $t = microtime(true); $this->_result = $this->_execute($sql, $params); diff --git a/app/Model/Datasource/Database/MysqlObserverExtended.php b/app/Model/Datasource/Database/MysqlObserverExtended.php index ecd05af25..1eeb3d465 100644 --- a/app/Model/Datasource/Database/MysqlObserverExtended.php +++ b/app/Model/Datasource/Database/MysqlObserverExtended.php @@ -144,6 +144,9 @@ class MysqlObserverExtended extends Mysql public function execute($sql, $options = [], $params = []) { $log = $options['log'] ?? $this->fullDebug; + if (Configure::read('Plugin.Benchmarking_enable')) { + $log = true; + } $comment = sprintf( '%s%s%s', empty(Configure::read('CurrentUserId')) ? '' : sprintf(