pub struct QueryLogger { /* private fields */ }Expand description
Query logger service
Implementations§
Source§impl QueryLogger
impl QueryLogger
pub fn new(config: QueryLogConfig) -> Self
pub fn with_default_config() -> Self
Sourcepub fn log_query(&self, query: &str, duration: Duration, location: Option<&str>)
pub fn log_query(&self, query: &str, duration: Duration, location: Option<&str>)
Log a query execution
Sourcepub fn get_stats(&self) -> Vec<QueryStats>
pub fn get_stats(&self) -> Vec<QueryStats>
Get statistics for all queries
Sourcepub fn get_slowest_queries(&self, n: usize) -> Vec<QueryStats>
pub fn get_slowest_queries(&self, n: usize) -> Vec<QueryStats>
Get top N slowest query patterns
Sourcepub fn get_most_frequent_queries(&self, n: usize) -> Vec<QueryStats>
pub fn get_most_frequent_queries(&self, n: usize) -> Vec<QueryStats>
Get top N most frequent queries
Sourcepub fn get_slow_query_history(&self, limit: usize) -> Vec<SlowQueryRecord>
pub fn get_slow_query_history(&self, limit: usize) -> Vec<SlowQueryRecord>
Get recent slow query records
Sourcepub fn get_aggregate_stats(&self) -> AggregateStats
pub fn get_aggregate_stats(&self) -> AggregateStats
Get aggregate statistics
Sourcepub fn reset_stats(&self)
pub fn reset_stats(&self)
Reset statistics
Auto Trait Implementations§
impl !Freeze for QueryLogger
impl !RefUnwindSafe for QueryLogger
impl Send for QueryLogger
impl Sync for QueryLogger
impl Unpin for QueryLogger
impl !UnwindSafe for QueryLogger
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