MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / buffer_stats

Method buffer_stats

nodedb/src/event/cdc/router.rs:262–276  ·  view source on GitHub ↗

Snapshot of all buffer stats (for SHOW CHANGE STREAMS).

(&self)

Source from the content-addressed store, hash-verified

260
261 /// Snapshot of all buffer stats (for SHOW CHANGE STREAMS).
262 pub fn buffer_stats(&self) -> Vec<BufferStats> {
263 let buffers = self.buffers.read().unwrap_or_else(|p| p.into_inner());
264 buffers
265 .iter()
266 .map(|((tid, name), buf)| BufferStats {
267 tenant_id: *tid,
268 stream_name: name.clone(),
269 buffered_events: buf.len(),
270 total_pushed: buf.total_pushed(),
271 total_evicted: buf.total_evicted(),
272 earliest_lsn: buf.earliest_lsn(),
273 latest_lsn: buf.latest_lsn(),
274 })
275 .collect()
276 }
277}
278
279/// Buffer statistics for observability.

Callers 1

spawn_compaction_taskFunction · 0.80

Calls 9

collectMethod · 0.80
total_pushedMethod · 0.80
total_evictedMethod · 0.80
earliest_lsnMethod · 0.80
latest_lsnMethod · 0.80
readMethod · 0.45
iterMethod · 0.45
cloneMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected