aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/topology/mod.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 00:46:06 +0100
committertv <tv@krebsco.de>2026-11-05 00:46:06 +0100
commit85c6a9a2ddeaf23066ddfa3362693604a37526ae (patch)
tree068a8dc4c24f5c64ad110d146dcd504718673eec /src/swarm/topology/mod.rs
parent4bb6282d6c439c40bceb3024afbc875f14aa4a9b (diff)
drop full mesh stat
Diffstat (limited to 'src/swarm/topology/mod.rs')
-rw-r--r--src/swarm/topology/mod.rs10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/swarm/topology/mod.rs b/src/swarm/topology/mod.rs
index b876fd0..afa13ee 100644
--- a/src/swarm/topology/mod.rs
+++ b/src/swarm/topology/mod.rs
@@ -57,7 +57,10 @@ pub(crate) struct NeighbourView {
/// they say they sync with us (`refresh`).
outbound: BTreeSet<String>,
neighbours: BTreeSet<String>,
- /// Every reachable member is a neighbour.
+ /// Every member not judged unreachable is a neighbour (the tests wait for it,
+ /// `is_full_mesh`). Not the swarm being a full mesh: members on a transport we are
+ /// not on, or that we never reached, don't count against it.
+ #[cfg(test)]
full_mesh: bool,
/// The graph the member list gives, as if every member reached every other
/// (`member_list_graph`): computed when first asked for, kept while the member list
@@ -123,7 +126,6 @@ pub(crate) struct Summary {
pub(crate) stable: usize,
pub(crate) neighbours: usize,
pub(crate) stable_neighbours: usize,
- pub(crate) full_mesh: bool,
}
pub(crate) fn summary(state: &AppState) -> Option<Summary> {
@@ -146,7 +148,6 @@ pub(crate) fn summary(state: &AppState) -> Option<Summary> {
.iter()
.filter(|m| view.stable.contains(*m))
.count(),
- full_mesh: view.full_mesh,
})
}
@@ -412,6 +413,7 @@ pub(crate) async fn refresh(state: &AppState) -> Option<NeighbourChange> {
&|m| stable.contains(m),
);
computed.extend(outbound.iter().cloned());
+ #[cfg(test)]
let listed_neighbours = computed.len();
computed.extend(unlisted.iter().cloned());
let change = NeighbourChange {
@@ -438,11 +440,13 @@ pub(crate) async fn refresh(state: &AppState) -> Option<NeighbourChange> {
removed = change.removed.len(),
"Neighbours computed from the member list"
);
+ #[cfg(test)]
let reachable_others = current
.iter()
.filter(|m| m.as_str() != state.local_id() && !unreachable.contains(*m))
.count();
*state.neighbours.write_or_recover() = Some(NeighbourView {
+ #[cfg(test)]
full_mesh: listed_neighbours >= reachable_others,
members: current,
k,