mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2026-10-31 00:47:14 +00:00
feat(web): record HTTP requests by route with latency for the traffic report
Requests are counted by route pattern and status class with a latency histogram (deferred requests until their answer goes out) and bytes sent. The web server reports pending deferred requests and WebSocket clients, the UGC server its worker threads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -58,6 +58,11 @@ public:
|
||||
// Main thread: what the server is doing, for /status
|
||||
nlohmann::json Status() const;
|
||||
|
||||
// Any thread: jobs waiting for a worker, and workers busy (traffic diagnostics)
|
||||
size_t Queued() const { std::lock_guard lock(m_Mutex); return m_Jobs.size(); }
|
||||
size_t Busy() const { std::lock_guard lock(m_Mutex); return m_Active; }
|
||||
size_t Threads() const { return m_Config.threads; }
|
||||
|
||||
private:
|
||||
struct Job {
|
||||
Kind kind{};
|
||||
|
||||
Reference in New Issue
Block a user