pub struct PoolStats {
pub total_resources: usize,
pub available_resources: usize,
pub active_resources: usize,
pub max_size: usize,
pub min_size: usize,
}Expand description
Statistics about a resource pool
Fields§
§total_resources: usizeTotal number of resources (active + available)
available_resources: usizeNumber of available resources in the pool
active_resources: usizeNumber of actively used resources
max_size: usizeMaximum pool size
min_size: usizeMinimum pool size
Implementations§
Source§impl PoolStats
impl PoolStats
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Get the pool utilization as a percentage (0.0 to 1.0)
Sourcepub fn is_at_capacity(&self) -> bool
pub fn is_at_capacity(&self) -> bool
Check if the pool is at capacity
Sourcepub fn is_below_minimum(&self) -> bool
pub fn is_below_minimum(&self) -> bool
Check if the pool is below minimum size
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PoolStats
impl RefUnwindSafe for PoolStats
impl Send for PoolStats
impl Sync for PoolStats
impl Unpin for PoolStats
impl UnsafeUnpin for PoolStats
impl UnwindSafe for PoolStats
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