]> git.mxchange.org Git - friendica.git/commitdiff
Fix the performance calculation for the content
authorMichael <heluecht@pirati.ca>
Thu, 9 Dec 2021 13:04:51 +0000 (13:04 +0000)
committerMichael <heluecht@pirati.ca>
Thu, 9 Dec 2021 13:04:51 +0000 (13:04 +0000)
src/App.php
src/App/Page.php

index d6532c445cc2ecafb6849d0095a5e1a67b1ce7cb..9cbac155b583df11b35b923669ef7c9f0f284db0 100644 (file)
@@ -707,7 +707,9 @@ class App
                        $input     = array_merge($httpinput['variables'], $httpinput['files'], $request ?? $_REQUEST);
 
                        // Let the module run it's internal process (init, get, post, ...)
+                       $timestamp = microtime(true);
                        $response = $module->run($input);
+                       $this->profiler->set(microtime(true) - $timestamp, 'content');
                        if ($response->getHeaderLine(ICanCreateResponses::X_HEADER) === ICanCreateResponses::TYPE_HTML) {
                                $page->run($this, $this->baseURL, $this->args, $this->mode, $response, $this->l10n, $this->profiler, $this->config, $pconfig);
                        } else {
index 479abfed92dc16ccaefe1aa85ce7e4f4ddec18a1..2b8fa26854e4db79e9e1c633859814df44f4fd7d 100644 (file)
@@ -420,7 +420,6 @@ class Page implements ArrayAccess
                 */
                $timestamp = microtime(true);
                $this->initContent($response, $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();
@@ -448,6 +447,8 @@ class Page implements ArrayAccess
                 */
                $this->initFooter($app, $mode, $l10n);
 
+               $profiler->set(microtime(true) - $timestamp, 'aftermath');
+
                if (!$mode->isAjax()) {
                        Hook::callAll('page_end', $this->page['content']);
                }