Skip to content

Commit ff3f513

Browse files
authored
Only load 5 most relevant traces on QueryCollector (#1479)
1 parent cc1456c commit ff3f513

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/DataCollector/QueryCollector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ public function addQuery($query, $bindings, $time, $connection)
177177

178178
if ($this->findSource) {
179179
try {
180-
$source = array_slice($this->findSource(), 0, 5);
180+
$source = $this->findSource();
181181
} catch (\Exception $e) {
182182
}
183183
}
@@ -272,7 +272,7 @@ protected function findSource()
272272
$sources[] = $this->parseTrace($index, $trace);
273273
}
274274

275-
return array_filter($sources);
275+
return array_slice(array_filter($sources), 0, 5);
276276
}
277277

278278
/**

0 commit comments

Comments
 (0)