pub struct BufferStats {
pub pending_count: u64,
pub latest_sequence: u64,
pub head_sequence: u64,
pub next_sequence: u64,
pub approx_disk_bytes: u64,
pub max_size_bytes: u64,
pub store_pressure: f32,
}Expand description
Point-in-time snapshot of buffer state, captured atomically under a single lock acquisition so all fields are mutually consistent.
Returned by SegmentBuffer::stats. Useful for metrics endpoints or
dashboards that need to observe multiple values without paying for several
lock/unlock round-trips (and risking a torn read between calls).
Fields§
§pending_count: u64Items waiting in the buffer (on-disk + in-memory pending).
Same value as SegmentBuffer::pending_count.
latest_sequence: u64Highest sequence number assigned (or 0 if the buffer is empty).
Same value as SegmentBuffer::latest_sequence.
head_sequence: u64Oldest unacknowledged sequence number (head_seq).
next_sequence: u64Next sequence number that will be assigned by the next successful
SegmentBuffer::append (next_seq).
approx_disk_bytes: u64Approximate total bytes used by segment files on disk. Decreases when
SegmentBuffer::delete_acked removes files.
max_size_bytes: u64Configured ceiling on disk usage (max_size_bytes). 0 disables the
limit; in that case store_pressure is 0.0.
store_pressure: f32approx_disk_bytes / max_size_bytes, clamped to [0.0, 1.0].
0.0 when no limit is configured.
Trait Implementations§
Source§impl Clone for BufferStats
impl Clone for BufferStats
Source§fn clone(&self) -> BufferStats
fn clone(&self) -> BufferStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more