pub struct PoolModeMetrics {Show 13 fields
pub acquires: AtomicU64,
pub releases: AtomicU64,
pub acquire_failures: AtomicU64,
pub acquire_timeouts: AtomicU64,
pub connections_created: AtomicU64,
pub connections_closed: AtomicU64,
pub connection_resets: AtomicU64,
pub reset_failures: AtomicU64,
pub transactions_completed: AtomicU64,
pub statements_executed: AtomicU64,
pub active_leases: AtomicU64,
pub peak_active_leases: AtomicU64,
pub queue_waits: AtomicU64,
/* private fields */
}Expand description
Connection pool metrics
Fields§
§acquires: AtomicU64Total connections acquired
releases: AtomicU64Total connections released
acquire_failures: AtomicU64Connection acquire failures
acquire_timeouts: AtomicU64Acquire timeouts
connections_created: AtomicU64Connections created
connections_closed: AtomicU64Connections closed
connection_resets: AtomicU64Connection resets performed
reset_failures: AtomicU64Reset failures
transactions_completed: AtomicU64Total transactions completed
statements_executed: AtomicU64Total statements executed
active_leases: AtomicU64Current active leases
peak_active_leases: AtomicU64Peak active leases
queue_waits: AtomicU64Queue wait count (when pool exhausted)
Implementations§
Source§impl PoolModeMetrics
impl PoolModeMetrics
Sourcepub fn record_acquire(&self, mode: PoolingMode)
pub fn record_acquire(&self, mode: PoolingMode)
Record a connection acquire
Sourcepub fn record_release(
&self,
mode: PoolingMode,
lease_duration_ms: u64,
statements: u64,
)
pub fn record_release( &self, mode: PoolingMode, lease_duration_ms: u64, statements: u64, )
Record a connection release
Sourcepub fn record_acquire_failure(&self)
pub fn record_acquire_failure(&self)
Record an acquire failure
Sourcepub fn record_acquire_timeout(&self)
pub fn record_acquire_timeout(&self)
Record an acquire timeout
Sourcepub fn record_connection_created(&self)
pub fn record_connection_created(&self)
Record connection creation
Sourcepub fn record_connection_closed(&self)
pub fn record_connection_closed(&self)
Record connection close
Sourcepub fn record_reset(&self, success: bool)
pub fn record_reset(&self, success: bool)
Record connection reset
Sourcepub fn record_transaction_complete(&self)
pub fn record_transaction_complete(&self)
Record transaction completion
Sourcepub fn record_queue_wait(&self)
pub fn record_queue_wait(&self)
Record queue wait
Sourcepub fn snapshot(&self) -> MetricsSnapshot
pub fn snapshot(&self) -> MetricsSnapshot
Get a snapshot of all metrics
Trait Implementations§
Source§impl Debug for PoolModeMetrics
impl Debug for PoolModeMetrics
Auto Trait Implementations§
impl !Freeze for PoolModeMetrics
impl !RefUnwindSafe for PoolModeMetrics
impl Send for PoolModeMetrics
impl Sync for PoolModeMetrics
impl Unpin for PoolModeMetrics
impl UnsafeUnpin for PoolModeMetrics
impl !UnwindSafe for PoolModeMetrics
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