aboutsummaryrefslogtreecommitdiffstats
path: root/src/swarm/stats.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/swarm/stats.rs')
-rw-r--r--src/swarm/stats.rs13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs
index da7544f..34542ff 100644
--- a/src/swarm/stats.rs
+++ b/src/swarm/stats.rs
@@ -115,9 +115,13 @@ pub(crate) struct Relay {
pub(crate) delivered: u64,
pub(crate) delivered_bytes: u64,
/// Sync messages received that carried changes, all of which we had already, and
- /// their payload's bytes: changes that came twice.
+ /// their payload's bytes: changes that came twice. Of those, how many came along a
+ /// writer's tree (`SyncEnvelope::writer`), and how many were taken as delivered by
+ /// their sender (`SyncEnvelope::delivered`).
pub(crate) nothing_new: u64,
pub(crate) nothing_new_bytes: u64,
+ pub(crate) nothing_new_along_trees: u64,
+ pub(crate) nothing_new_delivered: u64,
}
/// When the initial sync finished, and what it took.
@@ -219,11 +223,14 @@ impl NodeStats {
inner.relay.delivered_bytes += bytes as u64;
}
- /// A sync message of `bytes` payload carried changes, all of which we had already.
- pub(crate) fn nothing_new(&self, bytes: usize) {
+ /// A sync message of `bytes` payload carried changes, all of which we had already;
+ /// it came `along_tree`, or was `delivered`.
+ pub(crate) fn nothing_new(&self, bytes: usize, along_tree: bool, delivered: bool) {
let mut inner = self.lock();
inner.relay.nothing_new += 1;
inner.relay.nothing_new_bytes += bytes as u64;
+ inner.relay.nothing_new_along_trees += u64::from(along_tree);
+ inner.relay.nothing_new_delivered += u64::from(delivered);
}
/// A sync message of `bytes` arrived.