1
0
Fork 0

Improved performance profiler

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

View file

@ -36,6 +36,7 @@ use Friendica\Module\Special\HTTPException as ModuleHTTPException;
use Friendica\Network\HTTPException;
use Friendica\Util\Network;
use Friendica\Util\Strings;
use Friendica\Util\Profiler;
/**
* Contains the page specific environment variables for the current Page
@ -375,7 +376,7 @@ class Page implements ArrayAccess
*
* @throws HTTPException\InternalServerErrorException
*/
public function run(App $app, BaseURL $baseURL, Mode $mode, Module $module, L10n $l10n, IConfig $config, IPConfig $pconfig)
public function run(App $app, BaseURL $baseURL, Mode $mode, Module $module, L10n $l10n, Profiler $profiler, IConfig $config, IPConfig $pconfig)
{
$moduleName = $module->getName();
@ -384,7 +385,9 @@ class Page implements ArrayAccess
*
* Sets the $Page->page['content'] variable
*/
$timestamp = microtime(true);
$this->initContent($module, $mode);
$profiler->set(microtime(true) - $timestamp, 'content');
// Load current theme info after module has been initialized as theme could have been set in module
$currentTheme = $app->getCurrentTheme();