diff options
Diffstat (limited to 'src/swarm/stats.rs')
| -rw-r--r-- | src/swarm/stats.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index 02ccad5..218d5e8 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -166,6 +166,10 @@ pub(crate) struct Relay { /// counting them so (so they weren't what we passed on built on), and later. pub(crate) asked_known_lately: u64, pub(crate) asked_known_later: u64, + /// Messages taken as delivered by their sender, which was behind us: answered with + /// what it lacks (it got changes we had along its tree late, or we got them early by + /// another way). + pub(crate) answering_behind: 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, @@ -312,6 +316,11 @@ impl NodeStats { inner.relay.nothing_new_change_bytes += change_bytes as u64; } + /// A message taken as delivered came from a peer behind us (`Relay::answering_behind`). + pub(crate) fn answering_behind(&self) { + self.lock().relay.answering_behind += 1; + } + /// A sync message carried changes that wait for predecessors (`Relay::waiting`). pub(crate) fn waiting(&self) { self.lock().relay.waiting += 1; |
