diff options
| author | tv <tv@krebsco.de> | 2026-11-09 20:31:10 +0000 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-11-09 22:21:15 +0100 |
| commit | 67b5c3ae079f9f524bf0c52521a62811da407ad0 (patch) | |
| tree | db60596400fee35617d0fd3847987195efbb7ba0 /src/api/stats/prometheus.rs | |
| parent | 152890f321075beede075314d37ff6451604c359 (diff) | |
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.
Diffstat (limited to 'src/api/stats/prometheus.rs')
| -rw-r--r-- | src/api/stats/prometheus.rs | 8 |
1 files changed, 8 insertions, 0 deletions
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", |
