diff options
| author | tv <tv@krebsco.de> | 2026-11-05 16:10:14 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-05 16:10:14 +0100 |
| commit | 065bf2f9e738eae219da1fe0557ec22f94f10b7a (patch) | |
| tree | 4c4b8191cc7902898a776c429b6b9d09a798d26c /src/swarm/stats.rs | |
| parent | 12fae75f850c3ca63a68378b2684b5d89f667e10 (diff) | |
waiting not twice
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 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]) { |
