pub struct QueryStats { /* private fields */ }Implementations§
Source§impl QueryStats
impl QueryStats
pub fn new() -> Self
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn get(&self, sql: &str) -> Option<&QueryStat>
pub fn get(&self, sql: &str) -> Option<&QueryStat>
Returns the recorded stat snapshot, if any. Does NOT promote LRU (introspection should be side-effect free).
Sourcepub fn iter(&self) -> impl Iterator<Item = (&String, &QueryStat)>
pub fn iter(&self) -> impl Iterator<Item = (&String, &QueryStat)>
Iterate every recorded entry in deterministic (BTreeMap)
order. Used by spg_stat_query virtual table.
Sourcepub fn record(&mut self, sql: &str, elapsed_us: u64, now_us: u64)
pub fn record(&mut self, sql: &str, elapsed_us: u64, now_us: u64)
Record one execution. elapsed_us is the wall-clock micros
between start and end; now_us is the wall-clock micros at
completion (used for last_seen_us).
pub fn cap(&self) -> usize
Trait Implementations§
Source§impl Clone for QueryStats
impl Clone for QueryStats
Source§fn clone(&self) -> QueryStats
fn clone(&self) -> QueryStats
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for QueryStats
impl Debug for QueryStats
Source§impl Default for QueryStats
impl Default for QueryStats
Source§fn default() -> QueryStats
fn default() -> QueryStats
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for QueryStats
impl RefUnwindSafe for QueryStats
impl Send for QueryStats
impl Sync for QueryStats
impl Unpin for QueryStats
impl UnsafeUnpin for QueryStats
impl UnwindSafe for QueryStats
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