pub struct AnalyticsMetrics { /* private fields */ }Expand description
Analytics metrics aggregator
Implementations§
Source§impl AnalyticsMetrics
impl AnalyticsMetrics
Sourcepub fn with_max_recent(max_recent: usize) -> Self
pub fn with_max_recent(max_recent: usize) -> Self
Create with custom recent entries limit
Sourcepub fn record(
&self,
fingerprint: &QueryFingerprint,
execution: &QueryExecution,
intent: QueryIntent,
)
pub fn record( &self, fingerprint: &QueryFingerprint, execution: &QueryExecution, intent: QueryIntent, )
Record query execution
Sourcepub fn record_cache_hit(&self, intent: QueryIntent)
pub fn record_cache_hit(&self, intent: QueryIntent)
Record cache hit for an intent
Sourcepub fn snapshot(&self) -> AnalyticsSnapshot
pub fn snapshot(&self) -> AnalyticsSnapshot
Get snapshot of all metrics
Sourcepub fn by_intent(&self) -> HashMap<QueryIntent, IntentStats>
pub fn by_intent(&self) -> HashMap<QueryIntent, IntentStats>
Get metrics by intent
Sourcepub fn recent_queries(&self, limit: usize) -> Vec<QueryMetricEntry>
pub fn recent_queries(&self, limit: usize) -> Vec<QueryMetricEntry>
Get recent queries
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AnalyticsMetrics
impl !RefUnwindSafe for AnalyticsMetrics
impl Send for AnalyticsMetrics
impl Sync for AnalyticsMetrics
impl Unpin for AnalyticsMetrics
impl UnsafeUnpin for AnalyticsMetrics
impl UnwindSafe for AnalyticsMetrics
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