aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/throughput.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 06:02:19 +0100
committertv <tv@krebsco.de>2026-11-06 06:02:19 +0100
commitd9d398522a142283b537670068cc6418402d9546 (patch)
tree9253ee0761da39336296688f5c857786bcb9a665 /src/swarm/throughput.rs
parent77ffa8807d0cf1f06bc040052f6a1873536a0255 (diff)
soak with churn test
Diffstat (limited to 'src/swarm/throughput.rs')
-rw-r--r--src/swarm/throughput.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/swarm/throughput.rs b/src/swarm/throughput.rs
index ec50693..c9bf7ee 100644
--- a/src/swarm/throughput.rs
+++ b/src/swarm/throughput.rs
@@ -130,6 +130,12 @@ impl ThroughputTable {
pub(crate) fn retain(&mut self, mut keep: impl FnMut(&str) -> bool) {
self.peers.retain(|peer, _| keep(peer));
}
+
+ /// How many peers it holds an estimate of.
+ #[cfg(test)]
+ pub(crate) fn len(&self) -> usize {
+ self.peers.len()
+ }
}
#[cfg(test)]