From 1d573eada2ec3fcfed6499afb879c172e9c8b759 Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 05:21:07 +0200 Subject: record RTT sampling instant --- src/state.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/state.rs') diff --git a/src/state.rs b/src/state.rs index 6021baa..9d567a8 100644 --- a/src/state.rs +++ b/src/state.rs @@ -473,6 +473,12 @@ pub(crate) struct Timing { } impl Timing { + /// How long a round-trip sample stays meaningful (`swarm::rtt`): a few keepalive + /// intervals, since nodes move. + pub(crate) fn rtt_fresh_for(&self) -> Duration { + self.keepalive * 5 + } + // Recommended values // Environment | Keepalive | Notes // --------------------------------------------+-----------+------------------------------------------------------------ -- cgit v1.3.1