mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-02 02:43:44 +00:00
feat(dashboard): Diagnostics page with live traffic of every server
Keeps every server's traffic reports (last hour at one second, per-minute rows to server_traffic once a minute, pruned after traffic_days) and shows packets, bytes, HTTP requests and latency per second, per server, with the busiest message types and HTTP routes. Live over the traffic WebSocket topic; 1 hour, 24 hours and 7 days ranges. The same counters are in /metrics. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -84,6 +84,8 @@
|
||||
#include "InstanceLoad.h"
|
||||
#include "WorldView.h"
|
||||
#include "PrometheusMetrics.h"
|
||||
#include "Traffic.h"
|
||||
#include "master/ServerTraffic.h"
|
||||
#include "Background.h"
|
||||
#include "master/DashboardMessages.h"
|
||||
#include "master/DataChanged.h"
|
||||
@@ -322,6 +324,7 @@ namespace {
|
||||
handlers.On<DataChanged>(Master::DATA_CHANGED, [](const DataChanged& changed, const SystemAddress&) { BroadcastDataChanged(changed); });
|
||||
handlers.On<PlayerActionResult>(Master::PLAYER_ACTION_RESULT, [](const PlayerActionResult& result, const SystemAddress&) { PlayerActions::HandleResult(result); });
|
||||
handlers.On<MasterPackets::WorldShutDown>(Master::SHUTDOWN_RESPONSE, OnWorldShutDown);
|
||||
handlers.On<ServerTraffic>(Master::SERVER_TRAFFIC, [](const ServerTraffic& report, const SystemAddress&) { Traffic::Ingest(report); });
|
||||
return handlers;
|
||||
}();
|
||||
return handlers;
|
||||
@@ -524,6 +527,7 @@ int main(int argc, char** argv) {
|
||||
WorldView::RegisterRoutes();
|
||||
Scenery::RegisterRoutes();
|
||||
PrometheusMetrics::RegisterRoutes();
|
||||
Traffic::RegisterRoutes();
|
||||
RegisterPublicRoutes();
|
||||
RegisterShowcaseRoutes();
|
||||
FeaturedProperties::RegisterRoutes();
|
||||
@@ -582,6 +586,7 @@ int main(int argc, char** argv) {
|
||||
LiveEventRoutes::Update();
|
||||
ChallengeRoutes::Update();
|
||||
InstanceLoad::Update();
|
||||
Traffic::Update();
|
||||
|
||||
// Broadcast dashboard updates periodically
|
||||
if (elapsedSinceBroadcast >= broadcastInterval) {
|
||||
|
||||
Reference in New Issue
Block a user