From 2f241feb637bf71fe5077ba183ffabe03c8212f3 Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 03:44:02 +0100 Subject: drop peer.rttMs from /peers API --- docs/openapi.yaml | 3 --- src/api/peers.rs | 8 -------- src/api/stats/prometheus.rs | 16 ---------------- 3 files changed, 27 deletions(-) diff --git a/docs/openapi.yaml b/docs/openapi.yaml index be3005b..d7a3faa 100644 --- a/docs/openapi.yaml +++ b/docs/openapi.yaml @@ -1184,9 +1184,6 @@ components: neighbour: type: boolean description: We keep it alive and sync with it on our own; other peers we only answer. - rttMs: - type: [number, 'null'] - description: Round-trip time of the path messages to the peer go over (before that is measured, of HELLOs); null without a recent value. traffic: $ref: '#/components/schemas/Traffic' incidents: diff --git a/src/api/peers.rs b/src/api/peers.rs index a653f7d..cea3644 100644 --- a/src/api/peers.rs +++ b/src/api/peers.rs @@ -69,9 +69,6 @@ pub(crate) struct PeerStatus { heads: Option, /// We keep it alive and sync with it on our own; other peers we only answer. neighbour: bool, - /// Round-trip time in milliseconds of the path messages to it go over (`swarm::rtt`); - /// absent without a recent value. - rtt_ms: Option, /// Messages and payload bytes exchanged with it, by kind, since we started (or /// since it was last listed). traffic: PeerTraffic, @@ -124,10 +121,6 @@ pub(crate) async fn list_peers( for (peer, peer_state_mutex) in snapshot { let neighbour = crate::swarm::topology::is_neighbour(&state, &peer); - let rtt_ms = state - .lock_rtt() - .effective(&peer, now, state.timing.rtt_fresh_for()) - .map(|rtt| rtt.as_secs_f64() * 1000.0); let traffic = state.traffic.peer(&peer).unwrap_or_default(); let sync_throughput = state .throughput @@ -169,7 +162,6 @@ pub(crate) async fn list_peers( same_epoch: ps.epoch.map(|epoch| epoch == local_epoch), heads: ps.reported_heads, neighbour, - rtt_ms, traffic, incidents: ps.incidents, sync_throughput, diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 559a23e..8e6fde7 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -123,7 +123,6 @@ struct Peer { diverged_secs: Option, traffic: PeerTraffic, incidents: Incidents, - rtt_secs: Option, throughput: Option, destination: Option, } @@ -135,10 +134,6 @@ async fn peers(state: &AppState) -> Vec { let mut peers = Vec::with_capacity(snapshot.len()); for (key, peer_state) in snapshot { let neighbour = crate::swarm::topology::is_neighbour(state, &key); - let rtt_secs = state - .lock_rtt() - .effective(&key, now, state.timing.rtt_fresh_for()) - .map(|rtt| rtt.as_secs_f64()); let throughput = state .throughput .lock_or_recover() @@ -160,7 +155,6 @@ async fn peers(state: &AppState) -> Vec { .map(|t| now.saturating_duration_since(t).as_secs_f64()), traffic, incidents: peer_state.incidents, - rtt_secs, throughput, alias: aliases.remove(&key), destination: state.transport.destination(&key), @@ -805,16 +799,6 @@ pub(super) async fn render(state: &AppState, stats: &StatsResponse) -> String { out.sample("peer_diverged_seconds", &[("peer", &peer.key)], secs); } } - out.family( - "peer_rtt_seconds", - "gauge", - "Round-trip time of the path messages to the peer go over (before that, of HELLOs).", - ); - for peer in &peers { - if let Some(rtt) = peer.rtt_secs { - out.sample("peer_rtt_seconds", &[("peer", &peer.key)], rtt); - } - } out.family( "peer_sync_throughput_bytes_per_second", "gauge", -- cgit v1.3.1