Skip to content

Commit

Permalink
Mark collector as late collector (#731)
Browse files Browse the repository at this point in the history
  • Loading branch information
ostrolucky authored Dec 13, 2024
1 parent 7555c22 commit 1577b80
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/DataCollector/RedisDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,14 @@
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\DataCollector\DataCollector;
use Symfony\Component\HttpKernel\DataCollector\LateDataCollectorInterface;
use Throwable;

use function array_filter;
use function array_reduce;
use function count;

class RedisDataCollector extends DataCollector
class RedisDataCollector extends DataCollector implements LateDataCollectorInterface
{
protected RedisLogger $logger;

Expand Down Expand Up @@ -67,4 +68,9 @@ public function getName(): string
{
return 'redis';
}

public function lateCollect(): void
{
$this->data = ['commands' => $this->logger->getCommands()];
}
}

0 comments on commit 1577b80

Please sign in to comment.