Add command metrics#267
Open
llixon wants to merge 9 commits into
Open
Conversation
Collects per-server network I/O and command handler processing times, stored in TimeSeriesData and synchronized to Postgres metric tables. Includes startup retention cleanup for data older than 30 days.
Collects per-server network I/O and command handler processing times, stored in TimeSeriesData and synchronized to Postgres metric tables. Includes startup retention cleanup for data older than 30 days.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements command timing metrics as discussed, collected per-server and synchronized to Postgres.
What's collected
network::Server.CommandServerandChatterServer.Both are stored in
TimeSeriesDataand pulled by telemetry each sync tick, then written to the metric tables.Let me know if you want anything changed or added!
Design
Pull-based, per the discussion: the servers own the time series and expose getters (
GetSendTimeStatistics(),GetReceiveTimeStatistics(),GetProcessingTimeStatistics()), andTelemetryreaches them via the director → command/chatter server → server chain. Nothing in the network layer depends on telemetry.Covers all six servers: lobby, ranch, race, messenger, all-chat, and private chat. Send/receive live on the shared
network::Server; processing time lives on the dispatching server (CommandServer/ChatterServer).Storage notes
int64internally,intcolumn to match the existing metrics).timeprimary key the count metrics use, since many samples can share a one-second timestamp.Retention
On startup, rows older than 30 days are deleted from all metric tables (
CleanOldData).Drive-by fix
Noticed during testing that
Telemetry::Initialize()used a secondifinstead ofelse if, so the "unknown backend" warning fired even for valid backends (e.g.none). Fixed.Testing
Verified end-to-end against a local Postgres: lobby, ranch, messenger, and all-chat tables populate with sane microsecond values and no constraint violations. Private chat uses the same
ChatterServerpath as messenger/all-chat; its tables are created and wired identically but weren't exercised with live traffic (requires two clients whispering).