#[non_exhaustive]pub struct ObservabilityConfig {
pub slow_query_threshold: Option<Duration>,
}Expand description
可观测性运行期配置。
当前仅含慢查询阈值,预留后续扩展(如采样率、SQL 文本记录开关等)。
派生 Default(全部关闭),未向 Tools 注册时即等价于此默认值。
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.slow_query_threshold: Option<Duration>慢查询阈值:受保护层 TableQuery 单次执行耗时超过此值时 warn 日志。
None(默认)表示不启用慢查询日志,执行边界计时分支整体短路。
Implementations§
Source§impl ObservabilityConfig
impl ObservabilityConfig
Sourcepub fn with_slow_query_threshold(self, threshold: Duration) -> Self
pub fn with_slow_query_threshold(self, threshold: Duration) -> Self
设置慢查询阈值(链式)。
Trait Implementations§
Source§impl Clone for ObservabilityConfig
impl Clone for ObservabilityConfig
Source§impl Debug for ObservabilityConfig
impl Debug for ObservabilityConfig
Auto Trait Implementations§
impl Forget for ObservabilityConfig
impl Freeze for ObservabilityConfig
impl Move for ObservabilityConfig
impl RefUnwindSafe for ObservabilityConfig
impl Send for ObservabilityConfig
impl Sync for ObservabilityConfig
impl Unpin for ObservabilityConfig
impl UnsafeUnpin for ObservabilityConfig
impl UnwindSafe for ObservabilityConfig
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> 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