From a0152151a89035846d564231a4c0023b31dddc0e Mon Sep 17 00:00:00 2001 From: tv Date: Wed, 28 Oct 2026 05:42:07 +0100 Subject: add document lock stats --- src/api/stats.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/api/stats.rs') diff --git a/src/api/stats.rs b/src/api/stats.rs index 45d91da..07521ab 100644 --- a/src/api/stats.rs +++ b/src/api/stats.rs @@ -96,6 +96,9 @@ struct DocumentStats { saved_bytes_secs_ago: Option, /// How long the last measurement took (copy and save), in milliseconds. saved_bytes_took_ms: Option, + /// How long takers of the document's lock waited for it, since start: the node's + /// work on the one document queues there. + lock_wait: crate::document::lock::LockWaits, } #[derive(Debug, Serialize)] @@ -245,6 +248,7 @@ async fn collect(state: &AppState) -> StatsResponse { saved_bytes: saved.map(|s| s.bytes), saved_bytes_secs_ago: saved.map(|s| s.at.elapsed().as_secs()), saved_bytes_took_ms: saved.map(|s| s.took.as_millis() as u64), + lock_wait: state.doc.waits(), }, catch_up: CatchUpStats { sources: node.catch_up_sources, -- cgit v1.3.1