mirror of https://github.com/MISP/MISP
Merge branch '2.4' into develop
commit
91e1c27746
|
@ -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 = [
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue