Skip to main content

Runtime

Struct Runtime 

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

Owned fixed-stage metric storage that can be propagated across worker boundaries.

Implementations§

Source§

impl Runtime

Source

pub fn new() -> Self

Create an isolated runtime whose measurements can back one profiling session.

Source

pub fn context_id(&self) -> u64

Process-local identity that distinguishes this runtime from every peer.

Source

pub fn worker_shard_count(&self) -> usize

Number of isolated worker counter shards registered by this runtime.

Source

pub fn causal_parent(&self) -> CausalParent

Capture a portable token naming this runtime’s current causal parent.

Source

pub fn enter(&self) -> ContextGuard

Make this runtime current on the calling thread until the guard is dropped.

Source

pub fn scope<T>(&self, operation: impl FnOnce() -> T) -> T

Run one synchronous closure with this runtime as its current context.

Source

pub fn take_metric_distributions(&self) -> Vec<MetricDistributionV2>

Drain caller-recorded value distributions in stable metric order.

Source

pub fn take_legacy_typed_metrics(&self) -> Vec<TypedMetricRecordV2>

Drain typed counters recorded by the standalone (non-session) runtime.

Source

pub fn take_session_typed_metrics(&self) -> Vec<TypedMetricRecordV2>

Drain typed counter and gauge records in stable metric order.

Source

pub fn take_session_typed_events( &self, ) -> (Vec<PointEventV2>, Vec<AnnotationV2>, EventLossCounts)

Drain typed timeline records and exact loss counts by cause.

Source

pub fn take_session_span_records(&self) -> (Vec<SpanRecordV2>, u64)

Drain bounded causal spans and the exact count omitted or unfinished.

Source

pub fn take_session_latency_distributions(&self) -> Vec<LatencyDistributionV2>

Drain per-micro-function logarithmic latency distributions.

Source

pub fn take_session_batch_routes(&self) -> Vec<BatchRouteV2>

Drain completed batch-route records from this profiling runtime.

Source

pub fn take_session_dropped_batch_routes(&self) -> u64

Drain the count of batch routes dropped after MAX_BATCH_ROUTES.

Drain matched queue links in stable (queue, sequence) order with exact loss counts.

Source

pub fn take_session_queue_depths(&self) -> Vec<QueueDepthV2>

Drain queue depth occupancy and high-water records in stable queue order.

The current depth is reported without being reset; the high-water mark restarts from the current depth and the enqueue/dequeue totals reset.

Source

pub fn take_session_worker_imbalance(&self) -> WorkerImbalanceV2

Drain per-worker load and imbalance evidence merged in sorted shard order.

This drains the same per-stage call and elapsed counters as take_session_stage_measurements; call it once at session drain.

Source

pub fn take_session_blocked_waits(&self) -> Vec<BlockedWaitRecordV2>

Drain blocked-wait records merged in sorted shard order.

Source

pub fn take_session_stage_concurrency(&self) -> Vec<StageConcurrencyV2>

Drain per-micro-function wall-clock occupancy merged across workers.

Call this before Session::finish, which drains the shared per-stage call and elapsed counters this record reads.

Source

pub fn take_session_worker_occupancy(&self) -> WorkerOccupancyV2

Drain per-worker busy and blocked time merged in sorted shard order.

Source

pub fn take_session_cache_effectiveness(&self) -> Vec<CacheEffectivenessV2>

Drain reuse-cache hit and miss counts merged in sorted shard order.

Source

pub fn take_session_retries(&self) -> Vec<RetryRecordV2>

Drain retry attempts by cause, merged in sorted shard order.

Source

pub fn take_session_indexed_counters(&self) -> Vec<IndexedCounterRecordV2>

Drain indexed counter families merged in sorted shard order.

Trait Implementations§

Source§

impl Clone for Runtime

Source§

fn clone(&self) -> Runtime

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Runtime

Source§

fn default() -> Self

Returns the “default value” for a type. 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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.