1 | <?php |
||
26 | class CentrifugoCollector extends DataCollector |
||
27 | { |
||
28 | /** @var CommandHistoryLogger */ |
||
29 | private $centrifugoLogger; |
||
30 | |||
31 | /** |
||
32 | * @param CommandHistoryLogger $commandHistoryLogger |
||
33 | */ |
||
34 | public function __construct(CommandHistoryLogger $commandHistoryLogger) |
||
38 | |||
39 | /** |
||
40 | * {@inheritdoc} |
||
41 | */ |
||
42 | public function collect(Request $request, Response $response, \Throwable $exception = null): void |
||
46 | |||
47 | /** |
||
48 | * {@inheritdoc} |
||
49 | */ |
||
50 | public function getName(): string |
||
51 | { |
||
52 | return 'centrifugo'; |
||
53 | } |
||
54 | |||
55 | /** |
||
56 | * {@inheritdoc} |
||
57 | */ |
||
58 | public function reset(): void |
||
59 | { |
||
60 | $this->data = []; |
||
61 | $this->centrifugoLogger->clearCommandHistory(); |
||
62 | } |
||
63 | |||
64 | /** |
||
65 | * @return int |
||
66 | */ |
||
67 | public function getCommandCount(): int |
||
71 | |||
72 | /** |
||
73 | * @return int |
||
74 | */ |
||
75 | public function getRequestCount(): int |
||
79 | |||
80 | /** |
||
81 | * @return CommandInterface[] |
||
82 | */ |
||
83 | public function getCommands(): array |
||
87 | } |
||
88 |