diff options
| author | tv <tv@krebsco.de> | 2026-10-28 05:42:07 +0100 |
|---|---|---|
| committer | tv <tv@krebsco.de> | 2026-10-28 05:42:07 +0100 |
| commit | 3ba7a51b55603cbc3c9bdfb86a1ed37283691825 (patch) | |
| tree | 90cfb6232b8e7570171890f15f33b0d056bed7fc /src/api/stats.rs | |
| parent | 3695ca8d58001f17a46c42f00db24b0e77c8bcac (diff) | |
add document lock stats
Diffstat (limited to 'src/api/stats.rs')
| -rw-r--r-- | src/api/stats.rs | 4 |
1 files changed, 4 insertions, 0 deletions
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<u64>, /// How long the last measurement took (copy and save), in milliseconds. saved_bytes_took_ms: Option<u64>, + /// 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, |
