diff --git a/src/HttpApi/Controllers/TriggerEventController.php b/src/HttpApi/Controllers/TriggerEventController.php index 53ef72d..cd81729 100644 --- a/src/HttpApi/Controllers/TriggerEventController.php +++ b/src/HttpApi/Controllers/TriggerEventController.php @@ -28,7 +28,7 @@ class TriggerEventController extends Controller $request->json()->get('data') ); - StatisticsLogger::logApiMessage($request->appId); + StatisticsLogger::apiMessage($request->appId); } return $request->json()->all(); diff --git a/src/Statistics/Logger/FakeStatisticsLogger.php b/src/Statistics/Logger/FakeStatisticsLogger.php index eaefc1e..c1f8df3 100644 --- a/src/Statistics/Logger/FakeStatisticsLogger.php +++ b/src/Statistics/Logger/FakeStatisticsLogger.php @@ -10,22 +10,22 @@ use Ratchet\ConnectionInterface; class FakeStatisticsLogger implements StatisticsLogger { - public function logWebSocketMessage(ConnectionInterface $connection) + public function webSocketMessage(ConnectionInterface $connection) { } - public function logApiMessage($appId) + public function apiMessage($appId) { } - public function logConnection(ConnectionInterface $connection) + public function connection(ConnectionInterface $connection) { } - public function logDisconnection(ConnectionInterface $connection) + public function disconnection(ConnectionInterface $connection) { } diff --git a/src/Statistics/Logger/HttpStatisticsLogger.php b/src/Statistics/Logger/HttpStatisticsLogger.php index 327e980..c268991 100644 --- a/src/Statistics/Logger/HttpStatisticsLogger.php +++ b/src/Statistics/Logger/HttpStatisticsLogger.php @@ -23,32 +23,32 @@ class HttpStatisticsLogger implements StatisticsLogger $this->client = $client; } - public function logWebSocketMessage(ConnectionInterface $connection) + public function webSocketMessage(ConnectionInterface $connection) { $this->initializeStatistics($connection->app->id); - $this->statistics[$connection->app->id]->logWebSocketMessage(); + $this->statistics[$connection->app->id]->webSocketMessage(); } - public function logApiMessage($appId) + public function apiMessage($appId) { $this->initializeStatistics($appId); - $this->statistics[$appId]->logApiMessage(); + $this->statistics[$appId]->apiMessage(); } - public function logConnection(ConnectionInterface $connection) + public function connection(ConnectionInterface $connection) { $this->initializeStatistics($connection->app->id); - $this->statistics[$connection->app->id]->logConnection(); + $this->statistics[$connection->app->id]->connection(); } - public function logDisconnection(ConnectionInterface $connection) + public function disconnection(ConnectionInterface $connection) { $this->initializeStatistics($connection->app->id); - $this->statistics[$connection->app->id]->logDisconnection(); + $this->statistics[$connection->app->id]->disconnection(); } protected function initializeStatistics($id) diff --git a/src/Statistics/Logger/StatisticsLogger.php b/src/Statistics/Logger/StatisticsLogger.php index 001fe76..5b82884 100644 --- a/src/Statistics/Logger/StatisticsLogger.php +++ b/src/Statistics/Logger/StatisticsLogger.php @@ -2,17 +2,17 @@ namespace BeyondCode\LaravelWebSockets\Statistics\Logger; -use Ratchet\ConnectionInterface; +use Ratchet\connectionInterface; interface StatisticsLogger { - public function logWebSocketMessage(ConnectionInterface $connection); + public function webSocketMessage(connectionInterface $connection); - public function logApiMessage($appId); + public function apiMessage($appId); - public function logConnection(ConnectionInterface $connection); + public function connection(connectionInterface $connection); - public function logDisconnection(ConnectionInterface $connection); + public function disconnection(connectionInterface $connection); public function save(); } \ No newline at end of file diff --git a/src/Statistics/Statistic.php b/src/Statistics/Statistic.php index f9a060c..8fda8cc 100644 --- a/src/Statistics/Statistic.php +++ b/src/Statistics/Statistic.php @@ -31,26 +31,26 @@ class Statistic return App::findById($this->appId)->statisticsEnabled; } - public function logConnection() + public function connection() { $this->currentConnectionCount++; $this->peakConnectionCount = max($this->currentConnectionCount, $this->peakConnectionCount); } - public function logDisconnection() + public function disconnection() { $this->currentConnectionCount--; $this->peakConnectionCount = max($this->currentConnectionCount, $this->peakConnectionCount); } - public function logWebSocketMessage() + public function webSocketMessage() { $this->webSocketMessageCount++; } - public function logApiMessage() + public function apiMessage() { $this->apiMessageCount++; } diff --git a/src/WebSockets/WebSocketHandler.php b/src/WebSockets/WebSocketHandler.php index 60c302c..e2590fc 100644 --- a/src/WebSockets/WebSocketHandler.php +++ b/src/WebSockets/WebSocketHandler.php @@ -39,7 +39,7 @@ class WebSocketHandler implements MessageComponentInterface $message->respond(); - StatisticsLogger::logWebSocketMessage($connection); + StatisticsLogger::webSocketMessage($connection); } public function onClose(ConnectionInterface $connection) @@ -48,7 +48,7 @@ class WebSocketHandler implements MessageComponentInterface DashboardLogger::disconnection($connection); - StatisticsLogger::logDisconnection($connection); + StatisticsLogger::disconnection($connection); } public function onError(ConnectionInterface $connection, Exception $exception) @@ -94,7 +94,7 @@ class WebSocketHandler implements MessageComponentInterface DashboardLogger::connection($connection); - StatisticsLogger::logConnection($connection); + StatisticsLogger::connection($connection); return $this; }