summaryrefslogtreecommitdiffstats
path: root/src/api/stats.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/api/stats.rs')
-rw-r--r--src/api/stats.rs4
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,