From 806b34e9af4a7b0ca10376c1eaa8adddce1dce09 Mon Sep 17 00:00:00 2001 From: Joe Dixon Date: Wed, 8 May 2024 10:45:31 +0100 Subject: [PATCH] wip --- src/Protocols/Pusher/MetricsHandler.php | 5 ----- src/Servers/Reverb/Publishing/RedisPubSubProvider.php | 1 - .../Protocols/Pusher/Reverb/ChannelControllerTest.php | 2 -- 3 files changed, 8 deletions(-) diff --git a/src/Protocols/Pusher/MetricsHandler.php b/src/Protocols/Pusher/MetricsHandler.php index 64671ee8..18485a06 100644 --- a/src/Protocols/Pusher/MetricsHandler.php +++ b/src/Protocols/Pusher/MetricsHandler.php @@ -141,15 +141,12 @@ 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; }); } @@ -214,8 +211,6 @@ protected function listenForMetrics(string $key): Deferred $deferred = new Deferred; $this->pubSubProvider->on('metrics-retrieved', function ($payload) use ($key, $deferred) { - dump('Metrics received for '.$key); - if ($payload['key'] !== $key) { return; } diff --git a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php index e7dd736c..6b97909a 100644 --- a/src/Servers/Reverb/Publishing/RedisPubSubProvider.php +++ b/src/Servers/Reverb/Publishing/RedisPubSubProvider.php @@ -53,7 +53,6 @@ public function subscribe(): void $this->subscribingClient->subscribe($this->channel) ->then(function () { - dump('Subscribed to pubsub'); $this->subscribingClient->on('message', function (string $channel, string $payload) { $this->messageHandler->handle($payload); }); diff --git a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php index 66fe8c23..ea810525 100644 --- a/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php +++ b/tests/Feature/Protocols/Pusher/Reverb/ChannelControllerTest.php @@ -69,7 +69,6 @@ }); it('can gather data for a single channel', function () { - $start = microtime(true); $this->usingRedis(); subscribe('test-channel-one'); @@ -77,7 +76,6 @@ $response = await($this->signedRequest('channels/test-channel-one?info=user_count,subscription_count,cache')); - dump(microtime(true) - $start); expect($response->getStatusCode())->toBe(200); expect($response->getBody()->getContents())->toBe('{"occupied":true,"subscription_count":2}'); });