pub struct QueryPerformance {
pub duration_us: u64,
pub db_queries: u32,
pub complexity: u32,
pub cached: bool,
pub db_duration_us: u64,
pub parse_duration_us: u64,
pub validation_duration_us: u64,
}Expand description
Query performance data.
Fields§
§duration_us: u64Query execution time in microseconds
db_queries: u32Number of database queries executed
complexity: u32Estimated query complexity (field count, depth, etc.)
cached: boolWhether result was cached
db_duration_us: u64Database query time in microseconds
parse_duration_us: u64Parse time in microseconds (for compilation-free operation)
validation_duration_us: u64Validation time in microseconds
Implementations§
Source§impl QueryPerformance
impl QueryPerformance
Sourcepub fn new(
duration_us: u64,
db_queries: u32,
complexity: u32,
cached: bool,
db_duration_us: u64,
) -> Self
pub fn new( duration_us: u64, db_queries: u32, complexity: u32, cached: bool, db_duration_us: u64, ) -> Self
Create new query performance tracker.
Sourcepub fn with_parse_duration(self, duration_us: u64) -> Self
pub fn with_parse_duration(self, duration_us: u64) -> Self
Set parse duration.
Sourcepub fn with_validation_duration(self, duration_us: u64) -> Self
pub fn with_validation_duration(self, duration_us: u64) -> Self
Set validation duration.
Sourcepub fn non_db_duration_us(&self) -> u64
pub fn non_db_duration_us(&self) -> u64
Calculate total non-database time in microseconds.
Sourcepub fn db_percentage(&self) -> f64
pub fn db_percentage(&self) -> f64
Calculate database time percentage.
Trait Implementations§
Source§impl Clone for QueryPerformance
impl Clone for QueryPerformance
Source§fn clone(&self) -> QueryPerformance
fn clone(&self) -> QueryPerformance
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for QueryPerformance
impl RefUnwindSafe for QueryPerformance
impl Send for QueryPerformance
impl Sync for QueryPerformance
impl Unpin for QueryPerformance
impl UnsafeUnpin for QueryPerformance
impl UnwindSafe for QueryPerformance
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 moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request