aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--docs/measurements.md1
-rw-r--r--docs/openapi.yaml4
-rw-r--r--src/api/stats.rs2
-rw-r--r--src/api/stats/prometheus.rs6
-rw-r--r--src/swarm/topology/mod.rs10
5 files changed, 8 insertions, 15 deletions
diff --git a/docs/measurements.md b/docs/measurements.md
index 894ccd3..daf8008 100644
--- a/docs/measurements.md
+++ b/docs/measurements.md
@@ -98,7 +98,6 @@ or caught up over many small messages.
| `topology.view.stable` | `stable_members` | Members whose registry entry says `stable`. |
| `topology.view.neighbours` | `neighbours` | Current neighbours: peers this node keeps alive and syncs with on its own. At least `k` (links chosen by either end count); well above `k` on a stable member that many others chose, bounded at about 8 × k. |
| `topology.view.stableNeighbours` | `stable_neighbours` | Of those, stable members. |
-| `topology.view.fullMesh` | `full_mesh` | Every reachable member is a neighbour (at most `k + 1` reachable members). |
`view` is absent until the node is ready and knows the member list; until then
everyone counts as a neighbour.
diff --git a/docs/openapi.yaml b/docs/openapi.yaml
index 384e517..a1b9969 100644
--- a/docs/openapi.yaml
+++ b/docs/openapi.yaml
@@ -2069,7 +2069,7 @@ components:
oneOf:
- type: 'null'
- type: object
- required: [members, reachable, stable, neighbours, stableNeighbours, fullMesh]
+ required: [members, reachable, stable, neighbours, stableNeighbours]
properties:
members:
type: integer
@@ -2083,8 +2083,6 @@ components:
type: integer
stableNeighbours:
type: integer
- fullMesh:
- type: boolean
stability:
type: object
required: [tier, connectedFraction, observedSecs]
diff --git a/src/api/stats.rs b/src/api/stats.rs
index 0bdb1b6..5061ff7 100644
--- a/src/api/stats.rs
+++ b/src/api/stats.rs
@@ -187,7 +187,6 @@ struct TopologyView {
stable: usize,
neighbours: usize,
stable_neighbours: usize,
- full_mesh: bool,
}
#[derive(Debug, Serialize)]
@@ -359,7 +358,6 @@ pub(crate) async fn collect(state: &AppState, list: &PeerListResponse) -> StatsR
stable: s.stable,
neighbours: s.neighbours,
stable_neighbours: s.stable_neighbours,
- full_mesh: s.full_mesh,
}),
},
stability: StabilityStats {
diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs
index 5b1fc8c..595466a 100644
--- a/src/api/stats/prometheus.rs
+++ b/src/api/stats/prometheus.rs
@@ -713,12 +713,6 @@ pub(super) fn render(stats: &StatsResponse, list: &PeerListResponse) -> String {
"Current neighbours with the stable tier.",
view.stable_neighbours as f64,
);
- out.single(
- "full_mesh",
- "gauge",
- "1 while every reachable member is a neighbour.",
- flag(view.full_mesh),
- );
}
let stability = &stats.stability;
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,