diff options
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/stats.rs | 20 | ||||
| -rw-r--r-- | src/swarm/sync.rs | 6 |
2 files changed, 11 insertions, 15 deletions
diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index 8ab27e8..02ccad5 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -149,13 +149,11 @@ pub(crate) struct Relay { pub(crate) nothing_new_bytes: u64, pub(crate) nothing_new_along_trees: u64, pub(crate) nothing_new_delivered: u64, - /// Sync messages received that carried changes, the bytes of those changes, and of - /// their bloom filters; and the same of those with nothing new. + /// Sync messages received that carried changes, and the bytes of those changes; and + /// the same of those with nothing new. pub(crate) carrying: u64, pub(crate) carrying_change_bytes: u64, - 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. @@ -298,21 +296,20 @@ impl NodeStats { } /// A sync message of `bytes` payload carried changes, all of which we had already; - /// it came `along_tree`, or was `delivered`; `sizes`: of its changes and blooms. + /// it came `along_tree`, or was `delivered`; `change_bytes`: of its changes. pub(crate) fn nothing_new( &self, bytes: usize, along_tree: bool, delivered: bool, - sizes: (usize, usize), + change_bytes: usize, ) { let mut inner = self.lock(); inner.relay.nothing_new += 1; inner.relay.nothing_new_bytes += bytes as u64; inner.relay.nothing_new_along_trees += u64::from(along_tree); inner.relay.nothing_new_delivered += u64::from(delivered); - inner.relay.nothing_new_change_bytes += sizes.0 as u64; - inner.relay.nothing_new_bloom_bytes += sizes.1 as u64; + inner.relay.nothing_new_change_bytes += change_bytes as u64; } /// A sync message carried changes that wait for predecessors (`Relay::waiting`). @@ -328,12 +325,11 @@ impl NodeStats { inner.relay.off_tree_ms += delays_ms.iter().map(|ms| ms.max(&0)).sum::<i64>() as u64; } - /// A sync message carrying changes arrived; `sizes`: of its changes and blooms. - pub(crate) fn carrying(&self, sizes: (usize, usize)) { + /// A sync message carrying `change_bytes` of changes arrived. + pub(crate) fn carrying(&self, change_bytes: usize) { let mut inner = self.lock(); inner.relay.carrying += 1; - inner.relay.carrying_change_bytes += sizes.0 as u64; - inner.relay.carrying_bloom_bytes += sizes.1 as u64; + inner.relay.carrying_change_bytes += change_bytes as u64; } /// A peer asked for changes we had counted as its (`SyncSession::resend_if_needed`). diff --git a/src/swarm/sync.rs b/src/swarm/sync.rs index 5ee36a2..a6467a7 100644 --- a/src/swarm/sync.rs +++ b/src/swarm/sync.rs @@ -561,9 +561,9 @@ pub(crate) async fn handle_sync( return Ok(None); } let carried = message.carries_changes(); - let sizes = if carried { message.sizes() } else { (0, 0) }; + let change_bytes = if carried { message.change_bytes() } else { 0 }; if carried { - stats.carrying(sizes); + stats.carrying(change_bytes); } let mut peer_state = peer_state_mutex.blocking_lock(); @@ -621,7 +621,7 @@ pub(crate) async fn handle_sync( if !crate::document::changes::holds_all(&replica.doc, &said) { stats.waiting(); } else { - stats.nothing_new(payload_len, writer.is_some(), delivered, sizes); + stats.nothing_new(payload_len, writer.is_some(), delivered, change_bytes); } } // Whose they are, to pass them on along their writers' trees, however they |
