Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -88,9 +88,9 @@ public function getRenderCount(): int
return $this->data['render_count'] ?? 0;
}

public function getRenderTime(): int
public function getRenderTime(): float
{
return $this->data['render_time'] ?? 0;
return (float) ($this->data['render_time'] ?? 0);
}

private function collectDataFromLogger(): void
Expand Down Expand Up @@ -149,7 +149,7 @@ private function collectDataFromLogger(): void
$renders[$renderId] += [
'render_end' => $profile[0],
'render_time' => $renderTime,
'render_memory' => $profile[1],
'render_memory' => (int) $profile[1],
];

++$components[$componentName]['render_count'];
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
<span class="sf-toolbar-value">{{ collector.renderCount }}</span>
<span class="sf-toolbar-info-piece-additional-detail">
<span class="sf-toolbar-label">in</span>
<span class="sf-toolbar-value">{{ collector.renderTime }}</span>
<span class="sf-toolbar-value">{{ collector.renderTime|round }}</span>
<span class="sf-toolbar-label">ms</span>
</span>
{% endset %}
Expand Down Expand Up @@ -165,7 +165,7 @@
<div class="metric-divider"></div>
<div class="metric-group">
{{ _self.metric(collector.renderCount, "Render Count") }}
{{ _self.metric(collector.renderTime, "Render Time", "ms") }}
{{ _self.metric(collector.renderTime|round, "Render Time", "ms") }}
</div>
<div class="metric-divider"></div>
<div class="metric-group">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ public function testLateCollect(): void
$this->assertIsIterable($dataCollector->getRenders());
$this->assertEmpty($dataCollector->getRenders());

$this->assertSame(0, $dataCollector->getRenderTime());
$this->assertEquals(0.0, $dataCollector->getRenderTime());
}

public function testReset(): void
Expand Down