summaryrefslogtreecommitdiffstats
path: root/src/state.rs
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/state.rs
parentfb7e04544c798dcfa6a25f7db278427a9a39ddef (diff)
record RTT sampling instant
Diffstat (limited to 'src/state.rs')
-rw-r--r--src/state.rs6
1 files changed, 6 insertions, 0 deletions
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
// --------------------------------------------+-----------+------------------------------------------------------------