Skip to content

Commit 8d8ba85

Browse files
ACPT-1584
Fixing bug when fractional part of the timestamp is exactly zero.
1 parent 2f93e2a commit 8d8ba85

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/code/Magento/ApplicationPerformanceMonitor/Profiler/Output/LoggerOutput.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ public function isEnabled(): bool
4444
*/
4545
public function doOutput(array $metrics, array $information)
4646
{
47-
if (! $this->isEnabled()) {
47+
if (!$this->isEnabled()) {
4848
return;
4949
}
5050
if (!empty($information['subject'])) {
@@ -152,7 +152,8 @@ private function prettyElapsedTime(float $time): string
152152
*/
153153
private function prettyUnixTime(float $time): string
154154
{
155-
return \DateTime::createFromFormat('U.u', (string)$time)->format('Y-m-d\TH:i:s.u');
155+
$timeAsString = sprintf("%.1f", $time);
156+
return \DateTime::createFromFormat('U.u', $timeAsString)->format('Y-m-d\TH:i:s.u');
156157
}
157158

158159
/**

0 commit comments

Comments
 (0)