Improved page rendering speed logging
This commit is contained in:
parent
0747eb4961
commit
7ae500f28d
|
@ -586,7 +586,7 @@ class App
|
||||||
$this->profiler->set(microtime(true), 'classinit');
|
$this->profiler->set(microtime(true), 'classinit');
|
||||||
|
|
||||||
$moduleName = $this->args->getModuleName();
|
$moduleName = $this->args->getModuleName();
|
||||||
$page->setLogging($this->args->getCommand(), $this->args->getMethod());
|
$page->setLogging($this->args->getMethod(), $this->args->getModuleName(), $this->args->getCommand());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Missing DB connection: ERROR
|
// Missing DB connection: ERROR
|
||||||
|
|
|
@ -80,8 +80,9 @@ class Page implements ArrayAccess
|
||||||
private $basePath;
|
private $basePath;
|
||||||
|
|
||||||
private $timestamp = 0;
|
private $timestamp = 0;
|
||||||
private $command = '';
|
|
||||||
private $method = '';
|
private $method = '';
|
||||||
|
private $module = '';
|
||||||
|
private $command = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $basepath The Page basepath
|
* @param string $basepath The Page basepath
|
||||||
|
@ -92,21 +93,25 @@ class Page implements ArrayAccess
|
||||||
$this->basePath = $basepath;
|
$this->basePath = $basepath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setLogging(string $command, string $method)
|
public function setLogging(string $method, string $module, string $command)
|
||||||
{
|
{
|
||||||
$this->command = $command;
|
|
||||||
$this->method = $method;
|
$this->method = $method;
|
||||||
|
$this->module = $module;
|
||||||
|
$this->command = $command;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function logRuntime(IManageConfigValues $config, string $origin = '')
|
public function logRuntime(IManageConfigValues $config, string $origin = '')
|
||||||
{
|
{
|
||||||
if (in_array($this->command, $config->get('system', 'runtime_ignore'))) {
|
$ignore = $config->get('system', 'runtime_ignore');
|
||||||
|
if (in_array($this->module, $ignore) || in_array($this->command, $ignore)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
$signature = !empty($_SERVER['HTTP_SIGNATURE']);
|
||||||
|
$load = number_format(System::currentLoad(), 2);
|
||||||
|
$runtime = number_format(microtime(true) - $this->timestamp, 3);
|
||||||
if ($runtime > $config->get('system', 'runtime_loglimit')) {
|
if ($runtime > $config->get('system', 'runtime_loglimit')) {
|
||||||
Logger::debug('Runtime', ['method' => $this->method, 'command' => $this->command, 'runtime' => $runtime, 'origin' => $origin]);
|
Logger::debug('Runtime', ['method' => $this->method, 'module' => $this->module, 'runtime' => $runtime, 'load' => $load, 'origin' => $origin, 'signature' => $signature, 'request' => $_SERVER['REQUEST_URI'] ?? '']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user