Skip to main content

Crate naia_metrics

Crate naia_metrics 

Source
Expand description

Observability emission layer for naia game networking.

Emits network health data — RTT, jitter, packet loss, bandwidth — via the metrics crate facade. Install any compatible exporter at startup and naia’s data flows to your monitoring backend automatically.

§Non-Bevy usage

Call once per tick after server.send_all_packets():

naia_metrics::emit_server_aggregates(
    server.user_count(),
    server.entity_count(),
    server.room_count(),
);
for user_key in server.user_keys() {
    if let Some(stats) = server.connection_stats(&user_key) {
        naia_metrics::emit_server_connection_stats(&stats, user_key.to_u64());
    }
}

For Bevy apps, use [naia-bevy-metrics] instead — it handles emission automatically via a plugin.

Modules§

names

Functions§

emit_client_connection_stats
Emit the five client-side connection gauges.
emit_server_aggregates
Emit the three server-wide aggregate gauges.
emit_server_connection_stats
Emit the six per-connection gauges for one user.