pub struct PatternDetector { /* private fields */ }Expand description
Pattern detector
Implementations§
Source§impl PatternDetector
impl PatternDetector
Sourcepub fn new(config: PatternConfig) -> Self
pub fn new(config: PatternConfig) -> Self
Create new pattern detector
Sourcepub fn record_query(
&self,
session_id: &str,
_execution: &QueryExecution,
fingerprint: &QueryFingerprint,
)
pub fn record_query( &self, session_id: &str, _execution: &QueryExecution, fingerprint: &QueryFingerprint, )
Record a query execution
Sourcepub fn get_alerts(&self) -> Vec<PatternAlert>
pub fn get_alerts(&self) -> Vec<PatternAlert>
Get recent alerts
Sourcepub fn get_n_plus_one_alerts(&self) -> Vec<NplusOnePattern>
pub fn get_n_plus_one_alerts(&self) -> Vec<NplusOnePattern>
Get alerts by type
Sourcepub fn get_burst_alerts(&self) -> Vec<QueryBurst>
pub fn get_burst_alerts(&self) -> Vec<QueryBurst>
Get burst alerts
Sourcepub fn alert_count(&self) -> u64
pub fn alert_count(&self) -> u64
Get alert count
Sourcepub fn clear_alerts(&self)
pub fn clear_alerts(&self)
Clear alerts
Sourcepub fn session_count(&self) -> usize
pub fn session_count(&self) -> usize
Get session count
Auto Trait Implementations§
impl !Freeze for PatternDetector
impl !RefUnwindSafe for PatternDetector
impl Send for PatternDetector
impl Sync for PatternDetector
impl Unpin for PatternDetector
impl UnsafeUnpin for PatternDetector
impl UnwindSafe for PatternDetector
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> 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