pub struct DataScopeMetrics { /* private fields */ }Expand description
Data Scope 指标
Implementations§
Source§impl DataScopeMetrics
impl DataScopeMetrics
Sourcepub fn record_hit(&self, table: &str, mode: &str)
pub fn record_hit(&self, table: &str, mode: &str)
记录命中(数据范围条件注入成功)
Sourcepub fn record_bypass(&self, user_id: i64, table: &str)
pub fn record_bypass(&self, user_id: i64, table: &str)
记录绕过(超级管理员)
Sourcepub fn record_reject(&self, error_code: &str, table: &str)
pub fn record_reject(&self, error_code: &str, table: &str)
记录拒绝(错误发生)
Sourcepub fn record_eval(&self, elapsed_ms: u64)
pub fn record_eval(&self, elapsed_ms: u64)
记录评估耗时
Sourcepub fn bypass_total(&self) -> u64
pub fn bypass_total(&self) -> u64
获取绕过总数
Sourcepub fn reject_total(&self) -> u64
pub fn reject_total(&self) -> u64
获取拒绝总数
Sourcepub fn avg_eval_ms(&self) -> f64
pub fn avg_eval_ms(&self) -> f64
获取平均评估耗时(毫秒)
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for DataScopeMetrics
impl RefUnwindSafe for DataScopeMetrics
impl Send for DataScopeMetrics
impl Sync for DataScopeMetrics
impl Unpin for DataScopeMetrics
impl UnsafeUnpin for DataScopeMetrics
impl UnwindSafe for DataScopeMetrics
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