From 8414f96f27b059c4536ae67ddfce18dec54e7451 Mon Sep 17 00:00:00 2001 From: tv Date: Mon, 26 Oct 2026 20:48:08 +0100 Subject: add remake stats --- src/api/stats/prometheus.rs | 46 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) (limited to 'src/api/stats/prometheus.rs') diff --git a/src/api/stats/prometheus.rs b/src/api/stats/prometheus.rs index 3709ea4..6fd37a0 100644 --- a/src/api/stats/prometheus.rs +++ b/src/api/stats/prometheus.rs @@ -257,6 +257,52 @@ pub(super) async fn render(state: &AppState, stats: &StatsResponse) -> String { ); } + let remakes = &stats.remakes; + out.single( + "remakes_undecided", + "gauge", + "Remakes of the local epoch not decided yet (expired ones included).", + remakes.undecided as f64, + ); + out.single( + "remakes_committed", + "gauge", + "Committed remakes of the local epoch: 1 while switching; more is a double commit.", + remakes.committed as f64, + ); + out.single( + "rejoining", + "gauge", + "1 while syncing a newer epoch from scratch.", + flag(remakes.rejoining), + ); + out.single( + "catch_up_attempts", + "gauge", + "Attempts at catching up with a newer epoch (0 when not catching up).", + remakes.catch_up_attempts as f64, + ); + out.single( + "quarantined", + "gauge", + "Quarantined change sets (in memory only).", + remakes.quarantined as f64, + ); + if let Some(secs) = remakes.oldest_quarantine_secs { + out.single( + "oldest_quarantine_seconds", + "gauge", + "Age of the oldest quarantined change set.", + secs as f64, + ); + } + out.single( + "archived_epochs", + "gauge", + "Old epochs' documents kept in memory.", + remakes.archived_epochs as f64, + ); + let topology = &stats.topology; out.single( "neighbours_target", -- cgit v1.3.1