Skip to content

Commit

Permalink
enable memory_get_peak_usage
Browse files Browse the repository at this point in the history
  • Loading branch information
demidovich committed Sep 8, 2023
1 parent ba86dbd commit 5dec79b
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/Metrics/Metrics.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function runtime(): Runtime

public function memoryUsage(): int
{
return \memory_get_usage(false);
return \memory_get_peak_usage(true);
}

public function memoryUsageBuckets(): array
Expand Down
2 changes: 1 addition & 1 deletion tests/MetricsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public function test_memory_usage()
{
$metrics = $this->metrics();

$expected = \memory_get_usage(false);
$expected = \memory_get_peak_usage(true);

$this->assertEqualsWithDelta($expected, $metrics->memoryUsage(), 500);
}
Expand Down

0 comments on commit 5dec79b

Please sign in to comment.