aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 16:41:38 +0100
committertv <tv@krebsco.de>2026-11-05 16:41:38 +0100
commit565b27269b598de3e337d732525b2a171a30cb5e (patch)
tree7fa7ca968c8a23bb434684d9db6ce5adcd2351f3 /src/swarm/stats.rs
parentb3e102076666e515c77c50f0eb1150f44f0874e5 (diff)
answering behind counted
Diffstat (limited to 'src/swarm/stats.rs')
-rw-r--r--src/swarm/stats.rs9
1 files changed, 9 insertions, 0 deletions
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;