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.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs
index 5cac16a..ed12888 100644
--- a/src/swarm/stats.rs
+++ b/src/swarm/stats.rs
@@ -124,6 +124,13 @@ pub(crate) struct Relay {
/// Changes passed on along writers' trees (`swarm::tree`): a sync message asked for
/// per child.
pub(crate) tree_forwards: u64,
+ /// Whether the trees work, from what arrives (`tree::note_arrival`): sync messages
+ /// along a writer's tree, carrying changes, from a peer other than our parent in it
+ /// (a double send, or views of the tree that differ); and changes of writers in
+ /// whose trees we have a parent that came another way (pulled, with an answer, in
+ /// a delta: the tree didn't bring them).
+ pub(crate) tree_from_others: u64,
+ pub(crate) tree_missed: u64,
/// Sync messages sent taken as delivered (`SyncSession::assume_delivered`), and their
/// payload's bytes.
pub(crate) delivered: u64,
@@ -275,6 +282,16 @@ impl NodeStats {
self.lock().relay.tree_forwards += 1;
}
+ /// A sync message along a writer's tree came from a peer other than our parent in it.
+ pub(crate) fn tree_from_other(&self) {
+ self.lock().relay.tree_from_others += 1;
+ }
+
+ /// `count` changes of a writer in whose tree we have a parent came another way.
+ pub(crate) fn tree_missed(&self, count: usize) {
+ self.lock().relay.tree_missed += count as u64;
+ }
+
/// A blob chunk of `bytes` was served as `sent` bytes (fewer if deflated).
pub(crate) fn chunk_served(&self, bytes: usize, sent: usize) {
let mut inner = self.lock();