Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Commit 18dab98

Browse files
committed
Fixed dashboard statistics.
1 parent 25af2ee commit 18dab98

File tree

3 files changed

+21
-10
lines changed

3 files changed

+21
-10
lines changed

resources/views/dashboard.blade.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -347,14 +347,14 @@ class="rounded-full px-3 py-1 inline-block text-sm"
347347
name: '# Peak Connections'
348348
},
349349
{
350-
x: data.websocket_message_count.x,
351-
y: data.websocket_message_count.y,
350+
x: data.websocket_messages_count.x,
351+
y: data.websocket_messages_count.y,
352352
type: 'bar',
353353
name: '# Websocket Messages'
354354
},
355355
{
356-
x: data.api_message_count.x,
357-
y: data.api_message_count.y,
356+
x: data.api_messages_count.x,
357+
y: data.api_messages_count.y,
358358
type: 'bar',
359359
name: '# API Messages'
360360
},

src/Console/Commands/StartServer.php

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -128,12 +128,6 @@ protected function configureStatistics()
128128
return new $class;
129129
});
130130

131-
$this->laravel->singleton(StatisticsStore::class, function () {
132-
$class = config('websockets.statistics.store');
133-
134-
return new $class;
135-
});
136-
137131
if (! $this->option('disable-statistics')) {
138132
$intervalInSeconds = $this->option('statistics-interval') ?: config('websockets.statistics.interval_in_seconds', 3600);
139133

src/WebSocketsServiceProvider.php

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
namespace BeyondCode\LaravelWebSockets;
44

5+
use BeyondCode\LaravelWebSockets\Contracts\StatisticsStore;
56
use BeyondCode\LaravelWebSockets\Dashboard\Http\Controllers\AuthenticateDashboard;
67
use BeyondCode\LaravelWebSockets\Dashboard\Http\Controllers\SendMessage;
78
use BeyondCode\LaravelWebSockets\Dashboard\Http\Controllers\ShowDashboard;
@@ -34,6 +35,8 @@ public function boot()
3435
__DIR__.'/../database/migrations/0000_00_00_000000_rename_statistics_counters.php' => database_path('migrations/0000_00_00_000000_rename_statistics_counters.php'),
3536
], 'migrations');
3637

38+
$this->registerStatistics();
39+
3740
$this->registerDashboard();
3841

3942
$this->registerCommands();
@@ -50,6 +53,20 @@ public function register()
5053
$this->registerManagers();
5154
}
5255

56+
/**
57+
* Register the statistics-related contracts.
58+
*
59+
* @return void
60+
*/
61+
protected function registerStatistics()
62+
{
63+
$this->app->singleton(StatisticsStore::class, function () {
64+
$class = config('websockets.statistics.store');
65+
66+
return new $class;
67+
});
68+
}
69+
5370
/**
5471
* Regsiter the dashboard components.
5572
*

0 commit comments

Comments
 (0)