aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-03 06:11:06 +0100
committertv <tv@krebsco.de>2026-11-03 06:11:06 +0100
commitb16977b18fdd1e5193f5c015eadcb61a63f4fae1 (patch)
tree197a9fb7c0c0f5d5b799ecc3f3363c628a4f5e12 /src/swarm/stats.rs
parent698ab19bb74e1dbbc7c52fef96caede4d92caf55 (diff)
announcement round counters
Diffstat (limited to 'src/swarm/stats.rs')
-rw-r--r--src/swarm/stats.rs17
1 files changed, 15 insertions, 2 deletions
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) {