pub struct ExecutionMetadata {
pub compile_duration: Duration,
pub execute_duration: Duration,
pub query_shape_id: String,
pub rows_returned: Option<u64>,
pub outcome: Outcome,
}Expand description
Timing and result facts about one query execution.
Returned alongside the result rather than reported from inside the execution path, so the caller decides what to do with it — record a metric, attach it to a span, log it, or ignore it. Keeping the decision out here is what lets the same execution path serve an instrumented server and an uninstrumented script.
Fields§
§compile_duration: DurationPyQL → SQL compilation. Zero on a compile-cache hit, which is itself the signal that the cache is working.
execute_duration: DurationTime in the database, from handing over the SQL to having the rows.
query_shape_id: StringSee CompiledQuery::shape_id.
rows_returned: Option<u64>None for a statement that returns no rows, which is distinct from
Some(0) — a query that ran and matched nothing.
outcome: OutcomeImplementations§
Source§impl ExecutionMetadata
impl ExecutionMetadata
Sourcepub fn total_duration(&self) -> Duration
pub fn total_duration(&self) -> Duration
Compile plus execute — what a caller timing “the query” means.
Trait Implementations§
Source§impl Clone for ExecutionMetadata
impl Clone for ExecutionMetadata
Auto Trait Implementations§
impl Freeze for ExecutionMetadata
impl RefUnwindSafe for ExecutionMetadata
impl Send for ExecutionMetadata
impl Sync for ExecutionMetadata
impl Unpin for ExecutionMetadata
impl UnsafeUnpin for ExecutionMetadata
impl UnwindSafe for ExecutionMetadata
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Returns the layout of the type.
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Returns whether the given value has been niched. Read more
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
Writes data to
out indicating that a T is niched.