Skip to content

Commit b9634ea

Browse files
committed
Add reset_peak option on MemoryCollector
1 parent 9c08441 commit b9634ea

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

config/debugbar.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@
189189

190190
'options' => [
191191
'memory' => [
192+
'reset_peak' => false, // run memory_reset_peak_usage before collecting
192193
'with_baseline' => false, // Set boot memory usage as memory peak baseline
193194
],
194195
'auth' => [

src/LaravelDebugbar.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,9 @@ function () use ($debugbar, $startTime) {
171171

172172
if ($this->shouldCollect('memory', true)) {
173173
$this->addCollector(new MemoryCollector());
174-
174+
if (function_exists('memory_reset_peak_usage') && $app['config']->get('debugbar.options.memory.reset_peak')) {
175+
memory_reset_peak_usage();
176+
}
175177
if ($app['config']->get('debugbar.options.memory.with_baseline')) {
176178
$debugbar['memory']->resetMemoryBaseline();
177179
}

0 commit comments

Comments
 (0)