pub struct BufferStats {
pub budget: usize,
pub total_allocated: usize,
pub region_allocated: [usize; 4],
pub pressure_level: PressureLevel,
pub consumer_count: usize,
}Expand description
Statistics about buffer manager state.
Fields§
§budget: usizeTotal memory budget in bytes.
total_allocated: usizeTotal allocated bytes across all regions.
region_allocated: [usize; 4]Per-region allocation in bytes.
pressure_level: PressureLevelCurrent pressure level.
consumer_count: usizeNumber of registered consumers.
Implementations§
Source§impl BufferStats
impl BufferStats
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Returns the utilization as a fraction (0.0 to 1.0).
Sourcepub fn utilization_percent(&self) -> f64
pub fn utilization_percent(&self) -> f64
Returns the utilization as a percentage (0 to 100).
Sourcepub fn region_usage(&self, region: MemoryRegion) -> usize
pub fn region_usage(&self, region: MemoryRegion) -> usize
Returns allocated bytes for a specific region.
Trait Implementations§
Source§impl Clone for BufferStats
impl Clone for BufferStats
Source§fn clone(&self) -> BufferStats
fn clone(&self) -> BufferStats
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for BufferStats
impl Debug for BufferStats
Source§impl Default for BufferStats
impl Default for BufferStats
Auto Trait Implementations§
impl Freeze for BufferStats
impl RefUnwindSafe for BufferStats
impl Send for BufferStats
impl Sync for BufferStats
impl Unpin for BufferStats
impl UnwindSafe for BufferStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more