pub struct QueryStats {
pub query_count: AtomicU64,
pub mutation_count: AtomicU64,
pub subscription_count: AtomicU64,
/* private fields */
}Expand description
Query statistics
Fields§
§query_count: AtomicU64Total query count
mutation_count: AtomicU64Total mutation count
subscription_count: AtomicU64Total subscription count
Implementations§
Source§impl QueryStats
impl QueryStats
Sourcepub fn record(&self, duration: Duration, operation_type: OperationType)
pub fn record(&self, duration: Duration, operation_type: OperationType)
Record a query execution
Sourcepub fn total_count(&self) -> u64
pub fn total_count(&self) -> u64
Get total query count
Sourcepub fn average_duration(&self) -> Option<Duration>
pub fn average_duration(&self) -> Option<Duration>
Get average duration
Sourcepub fn min_duration(&self) -> Option<Duration>
pub fn min_duration(&self) -> Option<Duration>
Get minimum duration
Sourcepub fn max_duration(&self) -> Option<Duration>
pub fn max_duration(&self) -> Option<Duration>
Get maximum duration
Sourcepub fn percentile(&self, p: f64) -> Option<Duration>
pub fn percentile(&self, p: f64) -> Option<Duration>
Get percentile duration
Trait Implementations§
Source§impl Clone for QueryStats
impl Clone for QueryStats
Source§impl Debug for QueryStats
impl Debug for QueryStats
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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