Skip to content

Commit

Permalink
add application rendering duration
Browse files Browse the repository at this point in the history
  • Loading branch information
ArrayIterator committed Oct 14, 2023
1 parent 219f1e8 commit 53e769b
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions src/Benchmark/Waterfall.php
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,12 @@ private function closeTag(string $tag = 'div') : string
*/
public function createHtmlStructure(bool $showEmpty = false) : string
{
$microtimeStart = $_SERVER['REQUEST_TIME_FLOAT']
??$this->getProfiler()->getStartTime();
$firstRender = $this->getProfiler()->convertMicrotime(
microtime(true) - $microtimeStart
);

$memory_get_usage = memory_get_usage();
$memory_get_real_usage = memory_get_usage(true);
$memory_get_peak_usage = memory_get_peak_usage();
Expand Down Expand Up @@ -387,6 +393,19 @@ public function createHtmlStructure(bool $showEmpty = false) : string
),
round($profilerDurations, 2) . ' ms',
true
) . $this->createOpenTag(
'span',
$this->appendAttributeClass(
[
//'severity-info',
'info'
],
[
'title' => 'Application rendering duration'
]
),
round($firstRender, 2) . ' ms',
true
),
true,
false
Expand Down

0 comments on commit 53e769b

Please sign in to comment.