pub struct QueryProfiler { /* private fields */ }Expand description
Query profiler for tracking query performance
Implementations§
Source§impl QueryProfiler
impl QueryProfiler
pub fn new() -> Self
pub fn record(&mut self, query: String, duration: Duration, success: bool)
pub fn get_total_queries(&self) -> usize
pub fn get_successful_queries(&self) -> usize
pub fn get_total_duration(&self) -> Duration
pub fn get_average_duration(&self) -> Duration
pub fn get_slowest_query(&self) -> Option<&QueryProfileEntry>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for QueryProfiler
impl RefUnwindSafe for QueryProfiler
impl Send for QueryProfiler
impl Sync for QueryProfiler
impl Unpin for QueryProfiler
impl UnsafeUnpin for QueryProfiler
impl UnwindSafe for QueryProfiler
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