pub struct TimingStampMs {
pub elapsed_ms: f64,
pub parse_ms: f64,
pub plan_ms: f64,
pub execute_ms: f64,
pub lex_parse_ms: f64,
pub rewrite_ms: f64,
pub lower_ms: f64,
pub result_generation_ms: f64,
pub plan_cache: &'static str,
}Expand description
The statement’s timing block as one wire value — the wire-side spelling
of the engine’s result-header timing stamp: the ADR-0221 wall-clock
total (elapsed_ms) together with its always-on PARSE / PLAN / EXECUTE
split (ADR-0491) and the fine sub-split plus the plan-cache outcome
(LABS-1120), flattened to the envelope keys’ own milliseconds. Bundled
like the engine bundles its stamp, so an envelope construction site
cannot carry the total without its split — and the canonical builder
stays under clippy::too_many_arguments.
PARSE is the front-end parse and lowering; PLAN is binding, logical
planning and the admission classification; EXECUTE is the dispatch —
or, for EXPLAIN, the plan render, that path’s execute-equivalent
stage. The three are disjoint sub-windows of the window elapsed_ms
spans, so their sum never exceeds the total (the inter-stage gaps stay
in the total alone); milliseconds because this is the elapsed_ms
family it extends (Bolt’s seconds rendering is that surface’s own
conversion, per ADR-0491 §3). The LABS-1120 fine sub-windows partition
their coarse phase the same way; plan_cache explains a hit’s
near-zero parse window.
Fields§
§elapsed_ms: f64The ADR-0221 wall-clock total, in milliseconds.
parse_ms: f64The PARSE stage, in milliseconds.
plan_ms: f64The PLAN stage, in milliseconds.
execute_ms: f64The EXECUTE stage, in milliseconds.
lex_parse_ms: f64The PARSE stage’s lexing-plus-AST-build sub-window, in milliseconds
(LABS-1120) — zero on a plan-cache hit, which plan_cache explains.
rewrite_ms: f64The PARSE stage’s rewrite sub-window (the CIP-231 resolver), in milliseconds (LABS-1120) — zero on a plan-cache hit.
lower_ms: f64The PARSE stage’s validation-and-lowering sub-window, in milliseconds (LABS-1120) — zero on a plan-cache hit.
result_generation_ms: f64The EXECUTE stage’s result-generation sub-window, in milliseconds
(LABS-1120) — zero on the EXPLAIN path, whose render is itself
its result generation.
plan_cache: &'static strThe statement’s plan-cache outcome (LABS-1120) as the engine
enum’s own wire spelling (PlanCacheOutcome::as_str, kebab-case)
— never re-spelled here: the engine crate pins the vocabulary
against its enum with a test, so this field cannot drift from it.
Implementations§
Source§impl TimingStampMs
impl TimingStampMs
Sourcepub fn to_timings_json(&self) -> Value
pub fn to_timings_json(&self) -> Value
The nested timings object (LABS-1120): every duration key of the
stamp under one object — the form the surfaces that had no flat
elapsed_ms family before (the CLI machine modes, the HTTP Query
API v2 envelope) carry, so those envelopes stay forward-compatible
(a later phase joins the object, never the top level). The
plan-cache outcome rides beside the object, never inside it —
it is an outcome, not a duration. One builder for every surface, so
the key set cannot drift between them.