pub struct SlowQueryPlugin { /* private fields */ }Expand description
慢查询检测插件
Implementations§
Source§impl SlowQueryPlugin
impl SlowQueryPlugin
Sourcepub fn default_threshold() -> Self
pub fn default_threshold() -> Self
默认 1 秒阈值
Sourcepub fn with_kill_threshold(self, kill_threshold: Duration) -> Self
pub fn with_kill_threshold(self, kill_threshold: Duration) -> Self
任务6:设置 kill 阈值(超过此阈值时返回 Kill 决策)
Sourcepub fn slow_queries(&self) -> Vec<SlowQueryRecord>
pub fn slow_queries(&self) -> Vec<SlowQueryRecord>
获取所有慢查询记录
Trait Implementations§
Source§impl Plugin for SlowQueryPlugin
impl Plugin for SlowQueryPlugin
Source§fn stages(&self) -> Vec<ExecutionStage>
fn stages(&self) -> Vec<ExecutionStage>
拦截哪些阶段
Source§fn intercept(&self, context: &mut PluginContext) -> PluginDecision
fn intercept(&self, context: &mut PluginContext) -> PluginDecision
拦截处理
Auto Trait Implementations§
impl !Freeze for SlowQueryPlugin
impl !RefUnwindSafe for SlowQueryPlugin
impl Send for SlowQueryPlugin
impl Sync for SlowQueryPlugin
impl Unpin for SlowQueryPlugin
impl UnsafeUnpin for SlowQueryPlugin
impl UnwindSafe for SlowQueryPlugin
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