aboutsummaryrefslogtreecommitdiffstats
path: root/src/transport/paths.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-10-28 03:43:37 +0100
committertv <tv@krebsco.de>2026-10-28 03:43:37 +0100
commit9d60b8596f2b49e54d8a0811212b3dc2df94e1bd (patch)
treec18012acfd26644673949112fcb774ad0a5b4286 /src/transport/paths.rs
parent3fa8f9e360f0f7384986f2814f82b1124c25b8da (diff)
get swarm RTT from paths
Diffstat (limited to 'src/transport/paths.rs')
-rw-r--r--src/transport/paths.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/transport/paths.rs b/src/transport/paths.rs
index f5ea7a2..0f6ffe9 100644
--- a/src/transport/paths.rs
+++ b/src/transport/paths.rs
@@ -420,6 +420,11 @@ impl Paths {
self.table.lock_or_recover().rank(usable, Instant::now())
}
+ /// The smoothed round-trip time of the path to `address`, if measured.
+ pub(crate) fn rtt(&self, address: &str) -> Option<Duration> {
+ self.table.lock_or_recover().paths.get(address)?.rtt
+ }
+
/// What paths knows about each of `addresses`.
pub(crate) fn info(&self, addresses: &[String]) -> Vec<PathInfo> {
let now = Instant::now();