mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-18 02:32:50 +00:00
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>
22 lines
640 B
C++
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);
|
|
}
|