rift-metrics 0.1.4

Metrics collection and reporting for Rift P2P
Documentation

rift-metrics


Part of the riftd project — serverless P2P voice + text chat over UDP.

What's in this crate?

rift-metrics provides lightweight, thread-safe metrics collection:

  • Connection Stats — Track active connections and lifetime totals
  • Latency Metrics — RTT measurements and histograms
  • Throughput — Bytes sent/received tracking
  • NAT Traversal — Success/failure rates for hole punching
  • Global Registry — Thread-safe access via Metrics::global()

Usage

use rift_metrics::Metrics;

let metrics = Metrics::global();
metrics.record_connection();
metrics.record_bytes_sent(1024);

let snapshot = metrics.snapshot();
println!("Active connections: {}", snapshot.active_connections);

Related Crates

Crate Description
rift-mesh Mesh networking (uses metrics)
rift-nat NAT traversal (reports metrics)

Citation

If you use riftd in academic work, please cite:

de Beer, R. (2026). Predictive Rendezvous: Time–Intent–Deterministic Peer Coordination Without Infrastructure. Zenodo. https://doi.org/10.5281/zenodo.18528430

License

Licensed under either of Apache License, Version 2.0 or MIT license at your option.