From 0ea7f3aea1b007339c76427604cb551027379f81 Mon Sep 17 00:00:00 2001 From: tv Date: Fri, 6 Nov 2026 04:32:55 +0100 Subject: sent hashes measured --- src/document/sync.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/document/sync.rs') diff --git a/src/document/sync.rs b/src/document/sync.rs index 179df78..7123138 100644 --- a/src/document/sync.rs +++ b/src/document/sync.rs @@ -615,6 +615,14 @@ impl SyncSession { hashes.len() } + /// How many changes count as sent to the peer (`sent_hashes`): kept until the peer's + /// message says it has them (Automerge), or forgotten when a send fails or its + /// answer is overdue. + #[cfg(test)] + pub(crate) fn sent_hashes_len(&self) -> usize { + self.state.sent_hashes.len() + } + /// 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