pub struct PoolMonitor { /* private fields */ }Expand description
Connection pool monitor
Implementations§
Source§impl PoolMonitor
impl PoolMonitor
Sourcepub fn new(config: MonitorConfig) -> Self
pub fn new(config: MonitorConfig) -> Self
Create a new pool monitor
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create a monitor with default configuration
Sourcepub fn collect_metrics(&self, pool: &PgPool) -> PoolMetricsSnapshot
pub fn collect_metrics(&self, pool: &PgPool) -> PoolMetricsSnapshot
Collect current metrics and update history
Sourcepub fn generate_report(&self, pool: &PgPool) -> MonitoringReport
pub fn generate_report(&self, pool: &PgPool) -> MonitoringReport
Generate monitoring report with alerts
Sourcepub fn get_history(&self) -> Vec<PoolMetricsSnapshot>
pub fn get_history(&self) -> Vec<PoolMetricsSnapshot>
Get historical metrics
Sourcepub fn clear_history(&self)
pub fn clear_history(&self)
Clear historical data
Sourcepub fn history_count(&self) -> usize
pub fn history_count(&self) -> usize
Get the number of historical data points
Auto Trait Implementations§
impl Freeze for PoolMonitor
impl RefUnwindSafe for PoolMonitor
impl Send for PoolMonitor
impl Sync for PoolMonitor
impl Unpin for PoolMonitor
impl UnwindSafe for PoolMonitor
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> 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