From b16977b18fdd1e5193f5c015eadcb61a63f4fae1 Mon Sep 17 00:00:00 2001 From: tv Date: Tue, 3 Nov 2026 06:11:06 +0100 Subject: announcement round counters --- src/swarm/stats.rs | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/swarm/stats.rs') diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index 8a00629..9d32baa 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -98,6 +98,11 @@ pub(crate) struct SavedSize { pub(crate) struct Relay { /// Announcement rounds (each a STATUS to the neighbours). pub(crate) announce_rounds: u64, + /// Of those, quick rounds to all neighbours, as some change came with no writer's + /// tree to go along (pulled, a delta, from a node with no part in it), and slow rounds + /// after changes that did (`swarm::relay`). + pub(crate) treeless_rounds: u64, + pub(crate) slow_rounds: u64, /// Pulls started. pub(crate) pulls: u64, /// Announcements of heads we lacked that had to wait for the pull in progress. @@ -175,8 +180,16 @@ impl NodeStats { self.lock().stale_hello_replies += 1; } - pub(crate) fn announce_round(&self) { - self.lock().relay.announce_rounds += 1; + /// An announcement round: `treeless` (quick, to all), `slow`, or else quick to + /// those writers' trees leave out. + pub(crate) fn announce_round(&self, treeless: bool, slow: bool) { + let mut inner = self.lock(); + inner.relay.announce_rounds += 1; + if slow { + inner.relay.slow_rounds += 1; + } else if treeless { + inner.relay.treeless_rounds += 1; + } } pub(crate) fn pull_started(&self) { -- cgit v1.3.1