From 109a77cdd0f2fd479b5b6faf78c288a41d9ae6c7 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 04:50:55 +0100 Subject: sent hashes elsewhere measured --- src/document/sync.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/document/sync.rs') diff --git a/src/document/sync.rs b/src/document/sync.rs index 114b538..5d139e2 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -661,6 +661,16 @@ impl SyncSession { self.state.sent_hashes.len() } + /// Of those, how many count as sent because another parent brings them + /// (`known_to_peer`). + #[cfg(test)] + pub(crate) fn sent_known_elsewhere_len(&self) -> usize { + self.known_elsewhere + .keys() + .filter(|hash| self.state.sent_hashes.contains(*hash)) + .count() + } + /// Of the changes in `doc` beyond `from`, how many the peer has too, as far as we /// know (its heads' history, and what went either way since, `sent_hashes`). A delta /// it offers from `from` brings those again: offered before it heard what we have -- cgit v1.3.1