pub struct RuntimeObservationSession { /* private fields */ }Expand description
Owner-only capability for one query observation lifetime.
This type is intentionally not Clone. Cloneable execution contexts and
workers receive only RuntimeObservationHandle, which cannot seal.
Implementations§
Source§impl RuntimeObservationSession
impl RuntimeObservationSession
Sourcepub fn new(
query_id: impl Into<QueryId>,
trace_id: Option<TraceId>,
config: RuntimeObservationConfig,
) -> Self
pub fn new( query_id: impl Into<QueryId>, trace_id: Option<TraceId>, config: RuntimeObservationConfig, ) -> Self
Creates an owner and recording handle using a system monotonic clock.
Sourcepub fn with_clock(
query_id: impl Into<QueryId>,
trace_id: Option<TraceId>,
config: RuntimeObservationConfig,
clock: Arc<dyn RuntimeObservationClock>,
) -> Self
pub fn with_clock( query_id: impl Into<QueryId>, trace_id: Option<TraceId>, config: RuntimeObservationConfig, clock: Arc<dyn RuntimeObservationClock>, ) -> Self
Creates an owner and recording handle using an injected clock.
Sourcepub fn handle(&self) -> RuntimeObservationHandle
pub fn handle(&self) -> RuntimeObservationHandle
Returns a cloneable recording capability without seal authority.
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 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 seal(
&self,
outcome: RuntimeTerminalOutcome,
) -> Option<SealedRuntimeObservationSnapshot>
pub fn seal( &self, outcome: RuntimeTerminalOutcome, ) -> Option<SealedRuntimeObservationSnapshot>
Fixes the first terminal outcome and returns the same immutable snapshot to every later or concurrent seal.
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.
Trait Implementations§
Source§impl Debug for RuntimeObservationSession
impl Debug for RuntimeObservationSession
Auto Trait Implementations§
impl !RefUnwindSafe for RuntimeObservationSession
impl !UnwindSafe for RuntimeObservationSession
impl Freeze for RuntimeObservationSession
impl Send for RuntimeObservationSession
impl Sync for RuntimeObservationSession
impl Unpin for RuntimeObservationSession
impl UnsafeUnpin for RuntimeObservationSession
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> 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