mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-14 16:44:09 +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:
@@ -1,5 +1,6 @@
|
||||
#include "PrometheusMetrics.h"
|
||||
#include "MetricsFormat.h"
|
||||
#include "Traffic.h"
|
||||
|
||||
#include <algorithm>
|
||||
#include <chrono>
|
||||
@@ -266,6 +267,7 @@ namespace {
|
||||
if (!g_Text.empty() && now - g_BuiltAt < std::chrono::seconds(cacheSeconds)) return g_Text;
|
||||
MetricsFormat::Writer w;
|
||||
AddLive(w);
|
||||
Traffic::AddMetrics(w);
|
||||
AddDatabase(w);
|
||||
g_Text = w.Text();
|
||||
g_BuiltAt = now;
|
||||
|
||||
Reference in New Issue
Block a user