pub struct TelemetryMetrics { /* private fields */ }Expand description
遥测指标计数器(无锁原子操作)
Implementations§
Source§impl TelemetryMetrics
impl TelemetryMetrics
Sourcepub fn record_query(&self, duration: Duration, rows: u64)
pub fn record_query(&self, duration: Duration, rows: u64)
记录一次查询
Sourcepub fn record_query_error(&self)
pub fn record_query_error(&self)
记录一次查询错误
Sourcepub fn record_pool_acquire(&self, duration: Duration)
pub fn record_pool_acquire(&self, duration: Duration)
记录一次连接获取
Sourcepub fn record_prewarm_success(&self)
pub fn record_prewarm_success(&self)
v3.2.0:记录预热成功
Sourcepub fn record_prewarm_failure(&self)
pub fn record_prewarm_failure(&self)
v3.2.0:记录预热失败
Sourcepub fn record_prewarm_duration(&self, duration: Duration)
pub fn record_prewarm_duration(&self, duration: Duration)
v3.2.0:记录预热耗时
Sourcepub fn snapshot(&self) -> TelemetryMetricsSnapshot
pub fn snapshot(&self) -> TelemetryMetricsSnapshot
获取指标快照
Trait Implementations§
Source§impl Debug for TelemetryMetrics
impl Debug for TelemetryMetrics
Source§impl Default for TelemetryMetrics
impl Default for TelemetryMetrics
Source§fn default() -> TelemetryMetrics
fn default() -> TelemetryMetrics
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !Freeze for TelemetryMetrics
impl RefUnwindSafe for TelemetryMetrics
impl Send for TelemetryMetrics
impl Sync for TelemetryMetrics
impl Unpin for TelemetryMetrics
impl UnsafeUnpin for TelemetryMetrics
impl UnwindSafe for TelemetryMetrics
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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