From e163a8c9f64a2066350bd77e70c9c74202ca22df Mon Sep 17 00:00:00 2001 From: tv Date: Sat, 24 Oct 2026 07:04:54 +0200 Subject: add endpoint to export the document GET /admin/document to retrieve the automerge document. --- src/swarm/stats.rs | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'src/swarm/stats.rs') diff --git a/src/swarm/stats.rs b/src/swarm/stats.rs index fd88167..786734a 100644 --- a/src/swarm/stats.rs +++ b/src/swarm/stats.rs @@ -170,6 +170,15 @@ impl NodeStats { due } + /// The document was saved for another reason (an export): a measurement for free. + pub(crate) fn saved_size_measured(&self, bytes: u64, took: Duration) { + self.lock().saved_size = Some(SavedSize { + bytes, + at: Instant::now(), + took, + }); + } + fn finish_measuring(&self, measured: Option) { let mut inner = self.lock(); inner.measuring = false; -- cgit v1.3.1