Files
DarkflameServer/dDashboardServer/routes/Traffic.h
Aaron Kimbrell e6148a4021 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>
2026-09-28 22:31:02 -05:00

22 lines
640 B
C++

#pragma once
struct ServerTraffic;
namespace MetricsFormat { class Writer; }
/**
* Traffic diagnostics: every server's packets, bytes and HTTP requests (see ServerTraffic.h and TrafficHistory.h).
* The last hour is kept in memory at one second; finished minutes go to the server_traffic table once a minute.
*/
namespace Traffic {
void RegisterRoutes();
// SERVER_TRAFFIC from a server (via master), or the dashboard's own report
void Ingest(const ServerTraffic& report);
// Main loop: write finished minutes, tell open pages there is news
void Update();
// Counters for /metrics
void AddMetrics(MetricsFormat::Writer& w);
}