summaryrefslogtreecommitdiffstats
path: root/src/api
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-24 05:21:07 +0200
committertv <tv@krebsco.de>2026-10-24 05:21:42 +0200
commit81a6e029d835f576a4303b0fc78fbd8e2f26e2a7 (patch)
tree1539de56cfcbfed2099c205975ec848b058f4f70 /src/api
parentfb7e04544c798dcfa6a25f7db278427a9a39ddef (diff)
record RTT sampling instant
Diffstat (limited to 'src/api')
-rw-r--r--src/api/peers.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/api/peers.rs b/src/api/peers.rs
index 3893e0f..bafb5fa 100644
--- a/src/api/peers.rs
+++ b/src/api/peers.rs
@@ -62,8 +62,8 @@ pub(crate) struct PeerStatus {
heads: Option<usize>,
/// We keep it alive and sync with it on our own; other peers we only answer.
neighbour: bool,
- /// Smoothed round-trip time in milliseconds, from PING/PONG and HELLO/HELLO_REPLY;
- /// absent until measured.
+ /// Effective round-trip time in milliseconds (smoothed, raised by requests still
+ /// unanswered); absent without a recent sample.
rtt_ms: Option<f64>,
}
@@ -114,7 +114,7 @@ pub(crate) async fn list_peers(
let neighbour = crate::swarm::topology::is_neighbour(&state, &public_key);
let rtt_ms = state
.lock_rtt()
- .get(&public_key)
+ .effective(&public_key, now, state.timing.rtt_fresh_for())
.map(|rtt| rtt.as_secs_f64() * 1000.0);
let ps = peer_state_mutex.lock().await;