diff options
Diffstat (limited to 'src/api/stats')
| -rw-r--r-- | src/api/stats/prometheus.rs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 8b37864..690effa 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -363,6 +363,25 @@ fn transports(out: &mut Out, stats: &TransportStats) { } } +/// `/admin/stats` of a node that only relays. +pub(super) fn render_relay_only(stats: &super::RelayOnlyStats) -> String { + let mut out = Out::default(); + out.family( + "relay_info", + "gauge", + "This relay's libp2p peer ID (always 1); it is no node.", + ); + out.sample("relay_info", &[("peer_id", &stats.peer_id)], 1.0); + out.single( + "uptime_seconds", + "gauge", + "Seconds since this relay started.", + stats.uptime_secs as f64, + ); + transports(&mut out, &stats.transports); + out.0 +} + /// A per-peer incident counter: its name, its help and how to read it. type IncidentSeries = (&'static str, &'static str, fn(&Incidents) -> f64); |
