diff --git a/src/Protocols/Pusher/MetricsHandler.php b/src/Protocols/Pusher/MetricsHandler.php index 18485a06..a58d2262 100644 --- a/src/Protocols/Pusher/MetricsHandler.php +++ b/src/Protocols/Pusher/MetricsHandler.php @@ -141,12 +141,15 @@ protected function gatherMetricsFromSubscribers(Application $application, string */ protected function requestMetricsFromSubscribers(Application $application, string $key, string $type, ?array $options): void { + dump('Requesting metrics from subscribers using '.$key); + $this->pubSubProvider->publish([ 'type' => 'metrics', 'key' => $key, 'application' => serialize($application), 'payload' => ['type' => $type, 'options' => $options], ])->then(function ($total) { + dump('Total subscribers: '.$total); $this->subscribers = $total; }); } @@ -211,6 +214,8 @@ protected function listenForMetrics(string $key): Deferred $deferred = new Deferred; $this->pubSubProvider->on('metrics-retrieved', function ($payload) use ($key, $deferred) { + dump('Metrics received for '.$key, $payload); + if ($payload['key'] !== $key) { return; } diff --git a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php index 4ff8f6c6..66fe8c23 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php @@ -77,7 +77,7 @@ $response = await($this->signedRequest('channels/test-channel-one?info=user_count,subscription_count,cache')); - dump("Time: %f\n", microtime(true) - $start); + dump(microtime(true) - $start); expect($response->getStatusCode())->toBe(200); expect($response->getBody()->getContents())->toBe('{"occupied":true,"subscription_count":2}'); });