From 67b5c3ae079f9f524bf0c52521a62811da407ad0 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 9 Nov 2026 20:31:10 +0000 Subject: stats: the writers of the document How many writers (Automerge actors) the document's changes have matters: a writer is a node's run (each start, rejoin or drop makes one, a start keeping the one of before with `--keep-actor` after a clean stop), and every transfer of the whole history carries a signature for each. `/admin/stats` now says it (`document.writers`, and `document_writers` for Prometheus), counted from the changes' metadata alongside the saved size's measurement in the background (at least a minute apart), as that takes time proportional to the document too; an export, which measures the size alone, keeps the count of before. The dashboard's figures show it with the rest. --- src/api/stats/prometheus.rs | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/api/stats/prometheus.rs') diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 0d79d2c..ca3f1af 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -460,6 +460,14 @@ pub(super) fn render(stats: &StatsResponse, list: &PeerListResponse) -> String { "Most heads after applying a sync message, since start.", document.max_heads as f64, ); + if let Some(writers) = document.writers { + out.single( + "document_writers", + "gauge", + "Writers (Automerge actors, a node's run each) with changes in the document; counted in the background.", + writers as f64, + ); + } if let Some(bytes) = document.saved_bytes { out.single( "document_saved_bytes", -- cgit v1.3.1