Merge pull request #1055 from annando/profiler

Rendertime: Additional fields for the profiler
pull/1056/head
Hypolite Petovan 2020-12-09 21:04:28 -05:00 committed by GitHub
commit e6becaacd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 11 additions and 0 deletions

View File

@ -48,6 +48,17 @@ function rendertime_page_end(Friendica\App $a, &$o)
//round($profiler->get('plugin'), 3) //round($profiler->get('plugin'), 3)
) . '</div>'; ) . '</div>';
$total = microtime(true) - $profiler->get('start');
$rest = $total - ($profiler->get('ready') - $profiler->get('start')) - $profiler->get('init') - $profiler->get('content');
$o = $o . '<div class="renderinfo">' . 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),
round($profiler->get('content'), 3),
round($rest, 3),
round($total, 3)
) . '</div>';
if ($profiler->isRendertime()) { if ($profiler->isRendertime()) {
$o .= '<pre>'; $o .= '<pre>';
$o .= $profiler->getRendertimeString(DI::config()->get('rendertime', 'minimal_time', 0)); $o .= $profiler->getRendertimeString(DI::config()->get('rendertime', 'minimal_time', 0));