pub struct PoolStats {
pub size: u32,
pub num_idle: usize,
pub max_connections: u32,
pub min_connections: u32,
}Expand description
Pool statistics
Fields§
§size: u32Current number of connections in the pool
num_idle: usizeNumber of idle connections
max_connections: u32Maximum number of connections
min_connections: u32Minimum number of connections
Implementations§
Source§impl PoolStats
impl PoolStats
Sourcepub fn active_connections(&self) -> usize
pub fn active_connections(&self) -> usize
Number of active (non-idle) connections
Sourcepub fn has_available(&self) -> bool
pub fn has_available(&self) -> bool
Check if the pool has available connections
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Calculate 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 pool is at capacity
Sourcepub fn is_underutilized(&self) -> bool
pub fn is_underutilized(&self) -> bool
Check if pool is under-utilized (less than 50% of max)
Sourcepub fn is_overutilized(&self) -> bool
pub fn is_overutilized(&self) -> bool
Check if pool is over-utilized (more than 80% of max)
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 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more