pub struct RuntimeObservationHandle { /* private fields */ }Expand description
Cheaply cloneable recording capability without terminal-seal authority.
Implementations§
Source§impl RuntimeObservationHandle
impl RuntimeObservationHandle
Sourcepub const fn config(&self) -> RuntimeObservationConfig
pub const fn config(&self) -> RuntimeObservationConfig
Returns the immutable recorder configuration.
Sourcepub fn query_id(&self) -> Option<&QueryId>
pub fn query_id(&self) -> Option<&QueryId>
Returns the immutable query identity when recording is enabled.
Sourcepub fn trace_id(&self) -> Option<&TraceId>
pub fn trace_id(&self) -> Option<&TraceId>
Returns the immutable optional parent trace identity.
Sourcepub fn source_location_id(&self, value: &str) -> Option<RuntimeSourceLocationId>
pub fn source_location_id(&self, value: &str) -> Option<RuntimeSourceLocationId>
Returns a keyed, query-scoped source-location identity when recording is enabled.
Sourcepub fn record<F>(&self, build_payload: F) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
pub fn record<F>(&self, build_payload: F) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
Lazily constructs and records a query-level event.
Sourcepub fn record_for_plan<F>(
&self,
plan_execution_id: PlanExecutionId,
build_payload: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
pub fn record_for_plan<F>(
&self,
plan_execution_id: PlanExecutionId,
build_payload: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
Lazily constructs and records an event for one plan execution.
Sourcepub fn record_with_context<F>(
&self,
context: RuntimeEventContext,
build_payload: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
pub fn record_with_context<F>(
&self,
context: RuntimeEventContext,
build_payload: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeObservationPayload,
Lazily constructs an event before acquiring recorder order and records it infallibly.
Sourcepub fn record_topology<F>(
&self,
class: RuntimeObservationRecordClass,
build_record: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeTopologyRecord,
pub fn record_topology<F>(
&self,
class: RuntimeObservationRecordClass,
build_record: F,
) -> RuntimeObservationRecordDispositionwhere
F: FnOnce() -> RuntimeTopologyRecord,
Lazily constructs and records one static topology row.
Sourcepub fn live_snapshot(&self) -> Option<LiveRuntimeObservationSnapshot>
pub fn live_snapshot(&self) -> Option<LiveRuntimeObservationSnapshot>
Captures an immutable incomplete view. Returns none after sealing or when disabled.
Sourcepub fn sealed_snapshot(&self) -> Option<SealedRuntimeObservationSnapshot>
pub fn sealed_snapshot(&self) -> Option<SealedRuntimeObservationSnapshot>
Returns the sealed immutable snapshot when a terminal outcome was already fixed.
Sourcepub fn record_source_read(
&self,
plan_execution_id: &PlanExecutionId,
fact: SourceReadFact,
)
pub fn record_source_read( &self, plan_execution_id: &PlanExecutionId, fact: SourceReadFact, )
Folds one source-read fact into a plan execution’s exact totals.
This runs whether or not trace capture is enabled, and before any retention decision, so the totals never depend on what was retained. Facts arriving after the owner sealed are ignored.
Sourcepub fn record_source_read_row(
&self,
plan_execution_id: &PlanExecutionId,
row: SourceReadRuntimeMetrics,
)
pub fn record_source_read_row( &self, plan_execution_id: &PlanExecutionId, row: SourceReadRuntimeMetrics, )
Offers one source-read detail row for bounded retention.
Rows never feed totals; record the matching SourceReadFacts for
those. With trace capture disabled the row is intentionally not kept;
otherwise it is retained under the recorder’s record and byte limits,
which are shared by the whole query, and a declined row is counted as a
SourceReadDetail loss.
Sourcepub fn metrics_checkpoint(
&self,
plan_execution_id: &PlanExecutionId,
) -> Option<QueryMetricsCheckpoint>
pub fn metrics_checkpoint( &self, plan_execution_id: &PlanExecutionId, ) -> Option<QueryMetricsCheckpoint>
Returns one internally consistent view of a plan execution’s metrics.
Available for any query-bound session, including one whose trace
capture is disabled. A plan execution that recorded nothing yet reports
empty totals. Returns None only for Self::disabled.
Trait Implementations§
Source§impl Clone for RuntimeObservationHandle
impl Clone for RuntimeObservationHandle
Source§impl Debug for RuntimeObservationHandle
impl Debug for RuntimeObservationHandle
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeObservationHandle
impl !UnwindSafe for RuntimeObservationHandle
impl Freeze for RuntimeObservationHandle
impl Send for RuntimeObservationHandle
impl Sync for RuntimeObservationHandle
impl Unpin for RuntimeObservationHandle
impl UnsafeUnpin for RuntimeObservationHandle
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> 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> 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 more