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.rs9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs
index 31b6a3b..ba75d68 100644
--- a/src/swarm/stats.rs
+++ b/src/swarm/stats.rs
@@ -157,6 +157,10 @@ pub(crate) struct Relay {
pub(crate) carrying_bloom_bytes: u64,
pub(crate) nothing_new_change_bytes: u64,
pub(crate) nothing_new_bloom_bytes: u64,
+ /// Sync messages received that carried changes, none of them applied yet: they wait
+ /// for predecessors that didn't come (Automerge holds them back). Not counted with
+ /// `nothing_new`, which they aren't.
+ pub(crate) waiting: 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,
@@ -314,6 +318,11 @@ impl NodeStats {
inner.relay.nothing_new_bloom_bytes += sizes.1 as u64;
}
+ /// A sync message carried changes that wait for predecessors (`Relay::waiting`).
+ pub(crate) fn waiting(&self) {
+ self.lock().relay.waiting += 1;
+ }
+
/// Changes from elsewhere were applied, `delays_ms` after they were committed, that
/// came not along a writer's tree.
pub(crate) fn off_tree(&self, delays_ms: &[i64]) {