aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/stats.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-05 00:57:05 +0100
committertv <tv@krebsco.de>2026-11-05 00:57:05 +0100
commit0d16147e95211b0829fddaefb0d014fe0c48dbc8 (patch)
treee6b456a23ec9533010189279e4e9655978f481e1 /src/swarm/stats.rs
parent63871240278181f14af9d561f30b428d5db5e34a (diff)
new changes per message
Diffstat (limited to 'src/swarm/stats.rs')
-rw-r--r--src/swarm/stats.rs8
1 files changed, 8 insertions, 0 deletions
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();