pub struct ExtendedPoolStats {
pub pool_stats: DatabasePoolStats,
pub acquire_count: u64,
pub acquire_errors: u64,
pub created_at: Instant,
}Expand description
Extended pool statistics with additional metrics
Fields§
§pool_stats: DatabasePoolStats§acquire_count: u64§acquire_errors: u64§created_at: InstantImplementations§
Source§impl ExtendedPoolStats
impl ExtendedPoolStats
Sourcepub fn error_rate(&self) -> f64
pub fn error_rate(&self) -> f64
Calculate the error rate as a percentage
Sourcepub fn success_rate(&self) -> f64
pub fn success_rate(&self) -> f64
Calculate success rate as a percentage
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Get pool utilization as a percentage (active / total)
Sourcepub fn is_under_stress(&self, threshold: f64) -> bool
pub fn is_under_stress(&self, threshold: f64) -> bool
Check if the pool is under stress (high utilization)
Sourcepub fn has_concerning_error_rate(&self, threshold: f64) -> bool
pub fn has_concerning_error_rate(&self, threshold: f64) -> bool
Check if the error rate is concerning
Trait Implementations§
Source§impl Clone for ExtendedPoolStats
impl Clone for ExtendedPoolStats
Source§fn clone(&self) -> ExtendedPoolStats
fn clone(&self) -> ExtendedPoolStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ExtendedPoolStats
impl RefUnwindSafe for ExtendedPoolStats
impl Send for ExtendedPoolStats
impl Sync for ExtendedPoolStats
impl Unpin for ExtendedPoolStats
impl UnsafeUnpin for ExtendedPoolStats
impl UnwindSafe for ExtendedPoolStats
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,
impl<T> ErasedDestructor for Twhere
T: 'static,
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