From 065bf2f9e738eae219da1fe0557ec22f94f10b7a Mon Sep 17 00:00:00 2001 From: tv Date: Thu, 5 Nov 2026 16:10:14 +0100 Subject: waiting not twice --- src/swarm/stats.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/swarm/stats.rs') 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]) { -- cgit v1.3.1