pub struct FiltersFeature {
pub enable: bool,
pub meta: MetaFilters,
pub indicators: IndicatorFilters,
pub sql: SqlFilters,
}Expand description
过滤器配置 (重构后)
Fields§
§enable: bool是否启用过滤器
meta: MetaFilters元数据过滤器 (记录级: 只要命中其中一个就保留该记录 - OR 逻辑)
indicators: IndicatorFilters指标过滤器 (事务级: 命中即保留整笔事务 - 需要预扫描)
sql: SqlFiltersSQL 内容过滤器 (事务级: 未来扩展)
Implementations§
Source§impl FiltersFeature
impl FiltersFeature
pub fn validate()
Sourcepub fn has_filters(&self) -> bool
pub fn has_filters(&self) -> bool
检查是否配置了任何过滤器
Sourcepub fn has_transaction_filters(&self) -> bool
pub fn has_transaction_filters(&self) -> bool
检查是否提供了需要预扫描的过滤器 (Transaction-level)
Sourcepub fn should_keep(
&self,
ts: &str,
trxid: &str,
ip: &str,
sess: &str,
thrd: &str,
user: &str,
stmt: &str,
app: &str,
tag: Option<&str>,
) -> bool
pub fn should_keep( &self, ts: &str, trxid: &str, ip: &str, sess: &str, thrd: &str, user: &str, stmt: &str, app: &str, tag: Option<&str>, ) -> bool
检查记录是否应该被保留 逻辑:(满足时间过滤) AND ( (没有任何其他过滤) OR (满足任一元数据过滤) OR (属于被选中的事务) )
Sourcepub fn merge_found_trxids(&mut self, trxids: Vec<String>)
pub fn merge_found_trxids(&mut self, trxids: Vec<String>)
合并预扫描发现的事务 ID 到 MetaFilters 中,以便在正式扫描时直接通过 trxid 匹配保留整笔事务
Trait Implementations§
Source§impl Clone for FiltersFeature
impl Clone for FiltersFeature
Source§fn clone(&self) -> FiltersFeature
fn clone(&self) -> FiltersFeature
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FiltersFeature
impl Debug for FiltersFeature
Source§impl Default for FiltersFeature
impl Default for FiltersFeature
Source§fn default() -> FiltersFeature
fn default() -> FiltersFeature
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for FiltersFeature
impl<'de> Deserialize<'de> for FiltersFeature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for FiltersFeature
impl RefUnwindSafe for FiltersFeature
impl Send for FiltersFeature
impl Sync for FiltersFeature
impl Unpin for FiltersFeature
impl UnsafeUnpin for FiltersFeature
impl UnwindSafe for FiltersFeature
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> 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