pub struct QueryTimings {
pub query_id: String,
pub phases: Vec<(String, Duration)>,
pub total: Duration,
/* private fields */
}Expand description
Collected timing phases for a single query.
Fields§
§query_id: String§phases: Vec<(String, Duration)>§total: DurationImplementations§
Source§impl QueryTimings
impl QueryTimings
Sourcepub fn begin(query_id: impl Into<String>) -> Option<Self>
pub fn begin(query_id: impl Into<String>) -> Option<Self>
Create a new QueryTimings and start the total wall-clock timer.
Returns None when timing is disabled (zero overhead path).
Sourcepub fn begin_from_sql(sql: &str) -> Option<Self>
pub fn begin_from_sql(sql: &str) -> Option<Self>
Create a QueryTimings using the first [MAX_QUERY_ID_LENGTH] chars
of the SQL string as the query identifier.
Sourcepub fn start_phase(&self) -> Instant
pub fn start_phase(&self) -> Instant
Start timing a named phase. Returns the Instant to pass to [end_phase].
Sourcepub fn end_phase(&mut self, name: &str, since: Instant)
pub fn end_phase(&mut self, name: &str, since: Instant)
Record the elapsed time for a phase started with [start_phase].
Sourcepub fn add_accumulated_phase(&mut self, name: &str, duration: Duration)
pub fn add_accumulated_phase(&mut self, name: &str, duration: Duration)
Record a pre-computed duration for a phase that was accumulated across multiple iterations (e.g., per-table I/O totals).
Auto Trait Implementations§
impl Freeze for QueryTimings
impl RefUnwindSafe for QueryTimings
impl Send for QueryTimings
impl Sync for QueryTimings
impl Unpin for QueryTimings
impl UnsafeUnpin for QueryTimings
impl UnwindSafe for QueryTimings
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