Skip to main content

Module metrics

Module metrics 

Source
Expand description

Lock-free atomic metrics counters surfaced via Server::metrics_snapshot().

SP-concurrency-baseline §5.7 — gives adopters per-server observability without forcing a Prometheus-grade pipeline. Counters are updated on the hot path (accept, dispatch, audit) using Ordering::Relaxed since per- counter atomicity is enough — we never read multiple counters as one consistent snapshot.

Future SP-observability-v2 will layer latency histograms (p50 / p99) and a /metrics Prometheus endpoint on top of this counter base.

Structs§

MetricsCounters
Hot-path counters owned by ServerState. All fields are atomic so every transport (UDS via atd-server, HTTP via atd-server-http) and every dispatch path can bump them without coordinating.
MetricsSnapshot
JSON-serialisable snapshot of MetricsCounters. Returned by Server::metrics_snapshot() and atd-conformance scenarios that need to assert post-storm invariants (e.g. audit_drops_total == 0).