aboutsummaryrefslogtreecommitdiffstats
path: root/src/document/sync.rs
diff options
context:
space:
mode:
authortv <tv@krebsco.de>2026-11-06 04:50:55 +0100
committertv <tv@krebsco.de>2026-11-06 04:50:55 +0100
commit109a77cdd0f2fd479b5b6faf78c288a41d9ae6c7 (patch)
treee7f8deb5dd8bea4eee23f103744dedfffa7a1474 /src/document/sync.rs
parent50d57c3d223cb5fab3e213023c2466b602742106 (diff)
sent hashes elsewhere measured
Diffstat (limited to 'src/document/sync.rs')
-rw-r--r--src/document/sync.rs10
1 files changed, 10 insertions, 0 deletions
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