Improved performance profiler

This commit is contained in:
Michael 2020-12-09 22:10:27 +00:00
parent 9c0342b907
commit 5fb83d0632
5 changed files with 33 additions and 7 deletions

View file

@ -415,8 +415,14 @@ class App
* @throws HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public function runFrontend(App\Module $module, App\Router $router, IPConfig $pconfig, Authentication $auth, App\Page $page)
public function runFrontend(App\Module $module, App\Router $router, IPConfig $pconfig, Authentication $auth, App\Page $page, int $start_time = 0)
{
if ($start_time != 0) {
$this->profiler->set($start_time, 'start');
}
$this->profiler->set(microtime(true), 'classinit');
$moduleName = $module->getName();
try {
@ -551,12 +557,12 @@ class App
$module = $module->determineClass($this->args, $router, $this->config);
// Let the module run it's internal process (init, get, post, ...)
$module->run($this->l10n, $this->baseURL, $this->logger, $_SERVER, $_POST);
$module->run($this->l10n, $this->baseURL, $this->logger, $this->profiler, $_SERVER, $_POST);
} catch (HTTPException $e) {
ModuleHTTPException::rawContent($e);
}
$page->run($this, $this->baseURL, $this->mode, $module, $this->l10n, $this->config, $pconfig);
$page->run($this, $this->baseURL, $this->mode, $module, $this->l10n, $this->profiler, $this->config, $pconfig);
}
/**