diff options
| author | tv <tv@krebsco.de> | 2026-10-28 03:43:37 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 03:43:37 +0100 |
| commit | ff6d98bdd5f921942eb2b37d313d3b9d18acee40 (patch) | |
| tree | ef98a1542aee821006ece373c1ece536cc0e9596 /src/transport/paths.rs | |
| parent | 5184885fcec433d636060e5a4e889fa78827dadc (diff) | |
get swarm RTT from paths
Diffstat (limited to 'src/transport/paths.rs')
| -rw-r--r-- | src/transport/paths.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/transport/paths.rs b/src/transport/paths.rs index 643a238..a9bac49 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(); |
