Cockatrice/servatrice
Lukas Brübach a542831aad [Server] Instrument command processing, game starts, and event loops
Add a lock-free MetricsRegistry that accumulates per-command processing
times in preallocated histogram slots (one per protobuf command type,
bucketed at 1/5/10/25/50/100/250/500/1000/2500/5000 ms +Inf). The
hot-path observeCommand() uses only relaxed atomic adds — no locks,
no allocations, no cache-line ping-pong beyond the unavoidable counter
updates.

Wire the registry into AbstractServerSocketInterface::processCommandContainer()
so every processed command is attributed with its container's wall-clock
time. When a container exceeds metrics/slow_command_ms (default 500),
a warning is logged including the connected username.

Add an EventLoopWatchdog heartbeat that runs on every socket pool thread.
If a heartbeat overshoots metrics/stall_warn_ms (default 2000 ms), the
overshoot is recorded in atomic counters and a warning is logged. Both
thresholds are configurable in servatrice.ini; setting stall_warn_ms to 0
disables the watchdogs entirely.

Track game-start durations via a separate histogram in MetricsRegistry.
Server_Game::startGameNow() measures the time from zone creation through
player materialization and reports it via Server::observeGameStartDurationMs().

Add a live card-count gauge: Server_Game exposes getCardsInGame() and
Servatrice::getCardsInGamesTotal() sums across all running games under
the appropriate read locks.

Include a standalone metrics_registry_test (Google Test) that validates
empty registries, single/multi-sample histograms, kind encoding,
overflow-slot collapse, negative-duration clamping, gauge rendering,
and the game-start histogram separation.

Took 10 minutes
2026-09-11 09:01:55 +02:00
..
docker Docker-compose setup for Servatrice (#3887) 2020-03-16 21:40:58 -04:00
migrations [Server/Client/Protocol] Reporting users + moderation queue functionality (#7091) 2026-08-21 15:00:13 +02:00
mysql-storage Docker-Compose support for Windows (#3974) 2020-05-08 15:22:39 -04:00
resources Update macOS Monterey app icon (#4805) 2023-08-06 17:46:03 -04:00
scripts Add Discord account registration monitor (#7013) 2026-06-21 01:09:57 -04:00
src [Server] Instrument command processing, game starts, and event loops 2026-09-11 09:01:55 +02:00
check_schema_version.sh update format.sh (#6240) 2025-11-07 15:00:39 +01:00
CMakeLists.txt [Server] Instrument command processing, game starts, and event loops 2026-09-11 09:01:55 +02:00
servatrice.desktop Servatrice: open in a terminal window when started from the menu 2014-10-11 13:38:07 +02:00
servatrice.ini.example [Server] Instrument command processing, game starts, and event loops 2026-09-11 09:01:55 +02:00
servatrice.qrc Renamed resources 2014-10-07 16:49:40 +02:00
servatrice.rc Servatrice logo 2014-10-06 21:04:37 +02:00
servatrice.sql [Server/Client/Protocol] Address developer role review feedback 2026-09-11 08:45:33 +02:00