From 8340f3b1f45db8e11ecf4efc064aa0cbfab71699 Mon Sep 17 00:00:00 2001 From: Michael Date: Wed, 9 Dec 2020 22:10:44 +0000 Subject: [PATCH 1/3] Rendertime: Additional fields for the profiler --- rendertime/rendertime.php | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index 9edfde0b..b36602dd 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -48,6 +48,17 @@ function rendertime_page_end(Friendica\App $a, &$o) //round($profiler->get('plugin'), 3) ) . ''; + $total = microtime(true) - $profiler->get('start'); + $rest = $total - ($profiler->get('ready') - $profiler->get('start')) - $profiler->get('init') - $profiler->get('content'); + $o = $o . '
' . DI::l10n()->t("Boot: %s, Class-Init: %s, Init: %s, Content: %s, Other: %s, Total: %s", + round($profiler->get('ready') - $profiler->get('start'), 3), + round($profiler->get('classinit') - $profiler->get('start'), 3), + round($profiler->get('init'), 3), + round($profiler->get('content'), 3), + round($rest, 3), + round($total, 3) + ) . '
'; + if ($profiler->isRendertime()) { $o .= '
';
 			$o .= $profiler->getRendertimeString(DI::config()->get('rendertime', 'minimal_time', 0));

From ed672a36f5c144389052e8d85abf8c796b20ff13 Mon Sep 17 00:00:00 2001
From: Michael 
Date: Wed, 9 Dec 2020 22:42:45 +0000
Subject: [PATCH 2/3] Support for more fields

---
 rendertime/rendertime.php | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php
index b36602dd..acd35b34 100644
--- a/rendertime/rendertime.php
+++ b/rendertime/rendertime.php
@@ -50,9 +50,10 @@ function rendertime_page_end(Friendica\App $a, &$o)
 
 			$total = microtime(true) - $profiler->get('start');
 			$rest = $total - ($profiler->get('ready') - $profiler->get('start')) - $profiler->get('init') - $profiler->get('content');
-			$o = $o . '
' . DI::l10n()->t("Boot: %s, Class-Init: %s, Init: %s, Content: %s, Other: %s, Total: %s", - round($profiler->get('ready') - $profiler->get('start'), 3), + $o = $o . '
' . DI::l10n()->t("Class-Create: %s, Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s", + round($profiler->get('classcreate') - $profiler->get('start'), 3), round($profiler->get('classinit') - $profiler->get('start'), 3), + round($profiler->get('ready') - $profiler->get('classinit'), 3), round($profiler->get('init'), 3), round($profiler->get('content'), 3), round($rest, 3), From f11b6a1080022c20e692c542490bd699746a0217 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 10 Dec 2020 00:03:00 +0000 Subject: [PATCH 3/3] Cleaned up parameters --- rendertime/rendertime.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/rendertime/rendertime.php b/rendertime/rendertime.php index acd35b34..627c8cd9 100644 --- a/rendertime/rendertime.php +++ b/rendertime/rendertime.php @@ -50,8 +50,7 @@ function rendertime_page_end(Friendica\App $a, &$o) $total = microtime(true) - $profiler->get('start'); $rest = $total - ($profiler->get('ready') - $profiler->get('start')) - $profiler->get('init') - $profiler->get('content'); - $o = $o . '
' . DI::l10n()->t("Class-Create: %s, Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s", - round($profiler->get('classcreate') - $profiler->get('start'), 3), + $o = $o . '
' . DI::l10n()->t("Class-Init: %s, Boot: %s, Init: %s, Content: %s, Other: %s, Total: %s", round($profiler->get('classinit') - $profiler->get('start'), 3), round($profiler->get('ready') - $profiler->get('classinit'), 3), round($profiler->get('init'), 3),