pub struct QueryExecutionTrace {
pub query_id: String,
pub query: String,
pub phases: Vec<QueryPhaseSpan>,
pub total_duration_us: u64,
pub success: bool,
pub error: Option<String>,
pub result_count: Option<usize>,
}Expand description
Complete trace for a query execution.
Tracks all phases from initial parse through execution, enabling performance analysis and debugging.
Fields§
§query_id: StringUnique query ID for tracing correlation.
query: StringQuery string (truncated for large queries).
phases: Vec<QueryPhaseSpan>List of phase spans (parse, validate, execute, etc.).
total_duration_us: u64Total execution time in microseconds.
success: boolWhether execution succeeded.
error: Option<String>Optional error message.
result_count: Option<usize>Number of results returned.
Implementations§
Source§impl QueryExecutionTrace
impl QueryExecutionTrace
Sourcepub fn average_phase_duration_us(&self) -> u64
pub fn average_phase_duration_us(&self) -> u64
Get average phase duration in microseconds.
Sourcepub fn slowest_phase(&self) -> Option<&QueryPhaseSpan>
pub fn slowest_phase(&self) -> Option<&QueryPhaseSpan>
Get slowest phase.
Sourcepub fn to_log_string(&self) -> String
pub fn to_log_string(&self) -> String
Get trace as log-friendly string.
Suitable for structured logging or monitoring dashboards.
Trait Implementations§
Source§impl Clone for QueryExecutionTrace
impl Clone for QueryExecutionTrace
Source§fn clone(&self) -> QueryExecutionTrace
fn clone(&self) -> QueryExecutionTrace
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 moreSource§impl Debug for QueryExecutionTrace
impl Debug for QueryExecutionTrace
Source§impl<'de> Deserialize<'de> for QueryExecutionTrace
impl<'de> Deserialize<'de> for QueryExecutionTrace
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for QueryExecutionTrace
impl RefUnwindSafe for QueryExecutionTrace
impl Send for QueryExecutionTrace
impl Sync for QueryExecutionTrace
impl Unpin for QueryExecutionTrace
impl UnsafeUnpin for QueryExecutionTrace
impl UnwindSafe for QueryExecutionTrace
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