From 565b27269b598de3e337d732525b2a171a30cb5e Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 16:41:38 +0100 Subject: answering behind counted --- src/swarm/stats.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/swarm/stats.rs') diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index 02ccad5..218d5e8 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -166,6 +166,10 @@ pub(crate) struct Relay { /// counting them so (so they weren't what we passed on built on), and later. pub(crate) asked_known_lately: u64, pub(crate) asked_known_later: u64, + /// Messages taken as delivered by their sender, which was behind us: answered with + /// what it lacks (it got changes we had along its tree late, or we got them early by + /// another way). + pub(crate) answering_behind: u64, /// Changes from elsewhere that came not along a writer's tree (pulled, with an /// answer, sent again, fetched as a delta), and their delays summed (as `Propagation`). pub(crate) off_tree: u64, @@ -312,6 +316,11 @@ impl NodeStats { inner.relay.nothing_new_change_bytes += change_bytes as u64; } + /// A message taken as delivered came from a peer behind us (`Relay::answering_behind`). + pub(crate) fn answering_behind(&self) { + self.lock().relay.answering_behind += 1; + } + /// A sync message carried changes that wait for predecessors (`Relay::waiting`). pub(crate) fn waiting(&self) { self.lock().relay.waiting += 1; -- cgit v1.3.1