pub struct QuerySnapshot {Show 15 fields
pub query_info: QueryInfo,
pub total_duration: Duration,
pub time_to_first_chunk: Option<Duration>,
pub error_kind: Option<&'static str>,
pub direct_terminal_reason: Option<DirectFetchFailureReason>,
pub fetch_grpc_requests: u64,
pub fetch_grpc_bytes: u64,
pub fetch_direct_requests: u64,
pub fetch_direct_bytes: u64,
pub fetch_direct_retries: u64,
pub fetch_direct_requests_retried: u64,
pub fetch_direct_retry_sleep: Duration,
pub fetch_direct_max_attempt: u64,
pub fetch_direct_original_ranges: u64,
pub fetch_direct_merged_ranges: u64,
}Expand description
One completed query’s metrics, as seen from the client side.
Built once via build_query_snapshot and consumed by:
- the crate-private
analytics::PendingInner::dropwhen sending thePostHogOTLP span (so the span attributes are guaranteed to match what other readers see), - each subscribed
MetricsCollectorat end-of-stream, so Python code can read the metrics back without going through thedatafusion_ffiEXPLAIN ANALYZEpath that currently strips them.
Fields§
§query_info: QueryInfoPlan-time facts about the query, recorded once in scan() before any
execution. Embedded as-is so a new QueryInfo field automatically
flows through to every snapshot consumer.
total_duration: DurationWall-clock time from the start of scan() until the query finished
(cleanly or via error). Always populated.
time_to_first_chunk: Option<Duration>Time from scan_start until the first chunk reached the consumer.
None when no chunk was ever delivered (e.g. early error, empty
result).
error_kind: Option<&'static str>None on success. On failure, one of the stable
QueryErrorKind string labels
("grpc_fetch", "direct_fetch", "decode", "other").
direct_terminal_reason: Option<DirectFetchFailureReason>Reason a direct (HTTP Range) fetch hit a terminal failure — i.e. a
non-retryable error or retries exhausted. None when no direct fetch
terminally failed (this can be None even when error_kind is set,
if the failure was on the gRPC or decode path).
fetch_grpc_requests: u64Number of gRPC fetch calls the scanner issued.
fetch_grpc_bytes: u64Sum of chunk_byte_length (catalog metadata, compressed on-disk size)
over chunks fetched via gRPC. See the section comment above for what
this is and isn’t.
fetch_direct_requests: u64Number of direct (HTTP Range) fetches the scanner issued. Counts each merged request once, regardless of how many byte ranges it carried or how many attempts it took.
fetch_direct_bytes: u64Sum of chunk_byte_length (catalog metadata, compressed on-disk size)
over chunks fetched via direct HTTP. Notably this does not count
the filler bytes that range-merging pulls between adjacent chunks in
the same object, so actual wire traffic can exceed this value.
fetch_direct_retries: u64Total number of direct-fetch retry attempts across all requests. Each retry of a single request adds 1; a request retried 3 times contributes 3 here.
fetch_direct_requests_retried: u64Number of distinct direct-fetch requests that needed at least one
retry. Always ≤ fetch_direct_retries; the ratio between them is the
average retries per retried request.
fetch_direct_retry_sleep: DurationTotal backoff time slept across all direct-fetch retries
fetch_direct_max_attempt: u64True cross-partition max attempt number (via AtomicU64::fetch_max).
fetch_direct_original_ranges: u64Number of byte ranges the planner wanted to fetch directly, before
adjacent ranges were coalesced. With fetch_direct_merged_ranges,
gives the range-merging ratio.
fetch_direct_merged_ranges: u64Number of byte ranges actually issued after merging adjacent ranges
into combined HTTP Range requests. Equals fetch_direct_requests for
a single-range-per-request scanner.
Trait Implementations§
Source§impl Clone for QuerySnapshot
impl Clone for QuerySnapshot
Source§fn clone(&self) -> QuerySnapshot
fn clone(&self) -> QuerySnapshot
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for QuerySnapshot
impl Debug for QuerySnapshot
Source§impl PartialEq for QuerySnapshot
impl PartialEq for QuerySnapshot
Source§fn eq(&self, other: &QuerySnapshot) -> bool
fn eq(&self, other: &QuerySnapshot) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for QuerySnapshot
Auto Trait Implementations§
impl Freeze for QuerySnapshot
impl RefUnwindSafe for QuerySnapshot
impl Send for QuerySnapshot
impl Sync for QuerySnapshot
impl Unpin for QuerySnapshot
impl UnsafeUnpin for QuerySnapshot
impl UnwindSafe for QuerySnapshot
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
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
Source§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
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>
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>
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>
T in a tonic::Request