pub struct QueryAnalytics { /* private fields */ }Expand description
Main analytics engine
Implementations§
Source§impl QueryAnalytics
impl QueryAnalytics
Sourcepub fn new(config: AnalyticsConfig) -> Self
pub fn new(config: AnalyticsConfig) -> Self
Create new analytics engine
Sourcepub fn with_defaults() -> Self
pub fn with_defaults() -> Self
Create with default configuration
Sourcepub fn record(&self, execution: QueryExecution)
pub fn record(&self, execution: QueryExecution)
Record query execution
Sourcepub fn fingerprinter(&self) -> &QueryFingerprinter
pub fn fingerprinter(&self) -> &QueryFingerprinter
Get fingerprinter for external use
Sourcepub fn get_stats(&self, fingerprint_hash: u64) -> Option<QueryStats>
pub fn get_stats(&self, fingerprint_hash: u64) -> Option<QueryStats>
Get statistics for a fingerprint
Sourcepub fn top_queries(&self, order_by: OrderBy, limit: usize) -> Vec<QueryStats>
pub fn top_queries(&self, order_by: OrderBy, limit: usize) -> Vec<QueryStats>
Get top queries by a metric
Sourcepub fn slow_queries(&self, limit: usize) -> Vec<SlowQueryEntry>
pub fn slow_queries(&self, limit: usize) -> Vec<SlowQueryEntry>
Get recent slow queries
Sourcepub fn get_patterns(&self) -> Vec<PatternAlert>
pub fn get_patterns(&self) -> Vec<PatternAlert>
Get detected patterns
Sourcepub fn get_metrics(&self) -> AnalyticsSnapshot
pub fn get_metrics(&self) -> AnalyticsSnapshot
Get metrics snapshot
Sourcepub fn by_intent(&self) -> HashMap<QueryIntent, IntentStats>
pub fn by_intent(&self) -> HashMap<QueryIntent, IntentStats>
Get analytics by query intent
Sourcepub fn get_workflows(&self, limit: usize) -> Vec<WorkflowTrace>
pub fn get_workflows(&self, limit: usize) -> Vec<WorkflowTrace>
Get workflow traces
Sourcepub fn get_costs(&self) -> CostReport
pub fn get_costs(&self) -> CostReport
Get cost attribution
Auto Trait Implementations§
impl !Freeze for QueryAnalytics
impl !RefUnwindSafe for QueryAnalytics
impl Send for QueryAnalytics
impl Sync for QueryAnalytics
impl Unpin for QueryAnalytics
impl UnsafeUnpin for QueryAnalytics
impl UnwindSafe for QueryAnalytics
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