Skip to main content

RunBuilder

Struct RunBuilder 

Source
pub struct RunBuilder { /* private fields */ }
Expand description

Advanced/import API for completed-run artifact assembly.

RunBuilder assembles a finalized Run from already measured evidence. It validates event shape and timestamp ordering, but does not perform live request lifecycle tracking.

Elapsed duration fields such as request latency, stage latency, and queue wait are accepted as authoritative completed evidence. RunBuilder does not synthesize or repair durations from wall-clock timestamps.

Push methods use first-N retention through the same bounded retention/truncation helper used by the live collector. Overflow items are dropped and reflected in Run::truncation.

Implementations§

Source§

impl RunBuilder

Source

pub fn new(options: RunBuilderOptions) -> Result<Self, BuildError>

Creates a new completed-run builder from RunBuilderOptions.

§Errors

Returns BuildError::EmptyServiceName when the service name is blank.

Returns BuildError::InvalidRunTimeBounds when finished timestamp is earlier than start timestamp.

Returns BuildError::InvalidFinalizationTime when finalization timestamp is earlier than finished timestamp.

Source

pub fn push_request( &mut self, event: RequestEvent, ) -> Result<(), RunBuilderEventError>

Appends a request event.

The event is retained only while request capture-limit capacity remains; otherwise it is dropped and truncation.dropped_requests is updated.

§Errors

Returns RunBuilderEventError when the event has invalid shape.

Source

pub fn push_stage( &mut self, event: StageEvent, ) -> Result<(), RunBuilderEventError>

Appends a stage event.

The event is retained only while stage capture-limit capacity remains; otherwise it is dropped and truncation.dropped_stages is updated.

§Errors

Returns RunBuilderEventError when the event has invalid shape.

Source

pub fn push_queue( &mut self, event: QueueEvent, ) -> Result<(), RunBuilderEventError>

Appends a queue event.

The event is retained only while queue capture-limit capacity remains; otherwise it is dropped and truncation.dropped_queues is updated.

§Errors

Returns RunBuilderEventError when the event has invalid shape.

Source

pub fn push_inflight_snapshot( &mut self, snapshot: InFlightSnapshot, ) -> Result<(), RunBuilderEventError>

Appends an in-flight snapshot.

The snapshot is retained only while in-flight snapshot capture-limit capacity remains; otherwise it is dropped and truncation.dropped_inflight_snapshots is updated.

§Errors

Returns RunBuilderEventError when the snapshot has invalid shape.

Source

pub fn push_runtime_snapshot( &mut self, snapshot: RuntimeSnapshot, ) -> Result<(), RunBuilderEventError>

Appends a runtime snapshot.

The snapshot is retained only while runtime snapshot capture-limit capacity remains; otherwise it is dropped and truncation.dropped_runtime_snapshots is updated.

§Errors

Currently returns Ok(()) for all runtime snapshots. The Result keeps this API consistent with other RunBuilder push methods and leaves room for future runtime snapshot validation without changing the method shape.

Source

pub fn add_lifecycle_warning(&mut self, warning: impl Into<String>)

Adds one lifecycle warning string.

Source

pub fn set_unfinished_requests(&mut self, unfinished: UnfinishedRequests)

Sets unfinished-request metadata.

Source

pub fn set_effective_tokio_sampler_config( &mut self, config: EffectiveTokioSamplerConfig, )

Sets effective Tokio sampler configuration metadata.

Source

pub fn set_run_end_reason_if_absent(&mut self, reason: RunEndReason)

Sets run-end reason only when absent.

Source

pub fn finish(self) -> Run

Consumes the builder and returns the assembled finalized Run.

This does not perform lifecycle validation or synthesize missing completions.

Trait Implementations§

Source§

impl Debug for RunBuilder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.