From 0d16147e95211b0829fddaefb0d014fe0c48dbc8 Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 00:57:05 +0100 Subject: new changes per message --- src/swarm/stats.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/swarm/stats.rs') diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index c322305..b51a802 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -143,6 +143,9 @@ pub(crate) struct Relay { pub(crate) carrying_bloom_bytes: u64, pub(crate) nothing_new_change_bytes: u64, pub(crate) nothing_new_bloom_bytes: u64, + /// The changes new to us that sync messages brought (beside what they carried that + /// we had): with `carrying` less `nothing_new`, how many a message with news brings. + pub(crate) new_changes: 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, @@ -282,6 +285,11 @@ impl NodeStats { inner.relay.carrying_bloom_bytes += sizes.1 as u64; } + /// A sync message brought `count` changes new to us. + pub(crate) fn new_changes(&self, count: usize) { + self.lock().relay.new_changes += count as u64; + } + /// A sync message of `bytes` arrived. pub(crate) fn sync_received(&self, bytes: usize) { let mut inner = self.lock(); -- cgit v1.3.1