diff options
| author | tv <tv@krebsco.de> | 2026-11-06 06:58:48 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-06 06:58:48 +0100 |
| commit | 19461552f88e8b82a24c63c00a6591996ae8f45d (patch) | |
| tree | 14b095388f5751cde36e452bc502262f223cd3df /src/swarm/stats.rs | |
| parent | b4948712867819c20efcf2d4eb06ee9272196695 (diff) | |
trees at runtime
Diffstat (limited to 'src/swarm/stats.rs')
| -rw-r--r-- | src/swarm/stats.rs | 17 |
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(); |
