pub struct TelemetryMetricsSnapshot {
pub query_count: u64,
pub query_total_duration: Duration,
pub query_total_rows: u64,
pub pool_acquire_count: u64,
pub pool_acquire_total_duration: Duration,
pub query_error_count: u64,
pub prewarm_count: u64,
pub prewarm_failed_count: u64,
pub prewarm_duration: Duration,
}Expand description
指标快照
Fields§
§query_count: u64累计查询次数
query_total_duration: Duration累计查询耗时
query_total_rows: u64累计查询行数
pool_acquire_count: u64累计连接获取次数
pool_acquire_total_duration: Duration累计连接获取耗时
query_error_count: u64累计查询错误次数
prewarm_count: u64v3.2.0:预热成功次数
prewarm_failed_count: u64v3.2.0:预热失败次数
prewarm_duration: Durationv3.2.0:预热总耗时
Implementations§
Source§impl TelemetryMetricsSnapshot
impl TelemetryMetricsSnapshot
Sourcepub fn avg_query_duration(&self) -> Duration
pub fn avg_query_duration(&self) -> Duration
平均查询耗时
Sourcepub fn avg_query_rows(&self) -> f64
pub fn avg_query_rows(&self) -> f64
平均查询行数
Sourcepub fn query_error_rate(&self) -> f64
pub fn query_error_rate(&self) -> f64
查询错误率
Sourcepub fn avg_pool_acquire_duration(&self) -> Duration
pub fn avg_pool_acquire_duration(&self) -> Duration
平均连接获取耗时
Trait Implementations§
Source§impl Clone for TelemetryMetricsSnapshot
impl Clone for TelemetryMetricsSnapshot
Source§fn clone(&self) -> TelemetryMetricsSnapshot
fn clone(&self) -> TelemetryMetricsSnapshot
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 TelemetryMetricsSnapshot
impl RefUnwindSafe for TelemetryMetricsSnapshot
impl Send for TelemetryMetricsSnapshot
impl Sync for TelemetryMetricsSnapshot
impl Unpin for TelemetryMetricsSnapshot
impl UnsafeUnpin for TelemetryMetricsSnapshot
impl UnwindSafe for TelemetryMetricsSnapshot
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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