Skip to content

Commit 1577b80

Browse files
authored
Mark collector as late collector (#731)
1 parent 7555c22 commit 1577b80

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/DataCollector/RedisDataCollector.php

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,14 @@
1717
use Symfony\Component\HttpFoundation\Request;
1818
use Symfony\Component\HttpFoundation\Response;
1919
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
20+
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
2021
use Throwable;
2122

2223
use function array_filter;
2324
use function array_reduce;
2425
use function count;
2526

26-
class RedisDataCollector extends DataCollector
27+
class RedisDataCollector extends DataCollector implements LateDataCollectorInterface
2728
{
2829
protected RedisLogger $logger;
2930

@@ -67,4 +68,9 @@ public function getName(): string
6768
{
6869
return 'redis';
6970
}
71+
72+
public function lateCollect(): void
73+
{
74+
$this->data = ['commands' => $this->logger->getCommands()];
75+
}
7076
}

0 commit comments

Comments
 (0)