pub struct DatabaseMetrics;Expand description
No-op metrics collector when otel feature is disabled.
Implementations§
Source§impl DatabaseMetrics
impl DatabaseMetrics
Sourcepub fn new(
_pool_name: Option<&str>,
_server_address: &str,
_server_port: u16,
) -> Self
pub fn new( _pool_name: Option<&str>, _server_address: &str, _server_port: u16, ) -> Self
Create a new no-op metrics collector.
Sourcepub fn record_pool_status(&self, _in_use: u64, _idle: u64, _max: u64)
pub fn record_pool_status(&self, _in_use: u64, _idle: u64, _max: u64)
Record pool status (no-op).
Sourcepub fn record_connection_created(&self)
pub fn record_connection_created(&self)
Record connection created (no-op).
Sourcepub fn record_connection_closed(&self)
pub fn record_connection_closed(&self)
Record connection closed (no-op).
Sourcepub fn record_operation(
&self,
_operation: &str,
_duration_seconds: f64,
_success: bool,
)
pub fn record_operation( &self, _operation: &str, _duration_seconds: f64, _success: bool, )
Record operation (no-op).
Sourcepub fn record_connection_wait(&self, _duration_seconds: f64)
pub fn record_connection_wait(&self, _duration_seconds: f64)
Record connection wait time (no-op).
Trait Implementations§
Source§impl Clone for DatabaseMetrics
impl Clone for DatabaseMetrics
Source§fn clone(&self) -> DatabaseMetrics
fn clone(&self) -> DatabaseMetrics
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DatabaseMetrics
impl Debug for DatabaseMetrics
Source§impl Default for DatabaseMetrics
impl Default for DatabaseMetrics
Source§fn default() -> DatabaseMetrics
fn default() -> DatabaseMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for DatabaseMetrics
impl RefUnwindSafe for DatabaseMetrics
impl Send for DatabaseMetrics
impl Sync for DatabaseMetrics
impl Unpin for DatabaseMetrics
impl UnwindSafe for DatabaseMetrics
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