diff options
| author | tv <tv@krebsco.de> | 2026-10-24 07:04:54 +0200 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-24 07:04:54 +0200 |
| commit | e163a8c9f64a2066350bd77e70c9c74202ca22df (patch) | |
| tree | ef904d8f21aa53072073ef556a794392e5febaae /src/swarm | |
| parent | 8ee3b7f0d2f9b76cb24f0049431bd58d09d6c5a4 (diff) | |
add endpoint to export the document
GET /admin/document to retrieve the automerge document.
Diffstat (limited to 'src/swarm')
| -rw-r--r-- | src/swarm/stats.rs | 9 |
1 files changed, 9 insertions, 0 deletions
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<SavedSize>) { let mut inner = self.lock(); inner.measuring = false; |
