pub struct Runtime { /* private fields */ }Expand description
Owned fixed-stage metric storage that can be propagated across worker boundaries.
Implementations§
Source§impl Runtime
impl Runtime
Sourcepub fn new() -> Self
pub fn new() -> Self
Create an isolated runtime whose measurements can back one profiling session.
Sourcepub fn context_id(&self) -> u64
pub fn context_id(&self) -> u64
Process-local identity that distinguishes this runtime from every peer.
Sourcepub fn worker_shard_count(&self) -> usize
pub fn worker_shard_count(&self) -> usize
Number of isolated worker counter shards registered by this runtime.
Sourcepub fn causal_parent(&self) -> CausalParent
pub fn causal_parent(&self) -> CausalParent
Capture a portable token naming this runtime’s current causal parent.
Sourcepub fn enter(&self) -> ContextGuard
pub fn enter(&self) -> ContextGuard
Make this runtime current on the calling thread until the guard is dropped.
Sourcepub fn scope<T>(&self, operation: impl FnOnce() -> T) -> T
pub fn scope<T>(&self, operation: impl FnOnce() -> T) -> T
Run one synchronous closure with this runtime as its current context.
Sourcepub fn take_metric_distributions(&self) -> Vec<MetricDistributionV2>
pub fn take_metric_distributions(&self) -> Vec<MetricDistributionV2>
Drain caller-recorded value distributions in stable metric order.
Sourcepub fn take_legacy_typed_metrics(&self) -> Vec<TypedMetricRecordV2>
pub fn take_legacy_typed_metrics(&self) -> Vec<TypedMetricRecordV2>
Drain typed counters recorded by the standalone (non-session) runtime.
Sourcepub fn take_session_typed_metrics(&self) -> Vec<TypedMetricRecordV2>
pub fn take_session_typed_metrics(&self) -> Vec<TypedMetricRecordV2>
Drain typed counter and gauge records in stable metric order.
Sourcepub fn take_session_typed_events(
&self,
) -> (Vec<PointEventV2>, Vec<AnnotationV2>, EventLossCounts)
pub fn take_session_typed_events( &self, ) -> (Vec<PointEventV2>, Vec<AnnotationV2>, EventLossCounts)
Drain typed timeline records and exact loss counts by cause.
Sourcepub fn take_session_span_records(&self) -> (Vec<SpanRecordV2>, u64)
pub fn take_session_span_records(&self) -> (Vec<SpanRecordV2>, u64)
Drain bounded causal spans and the exact count omitted or unfinished.
Sourcepub fn take_session_latency_distributions(&self) -> Vec<LatencyDistributionV2>
pub fn take_session_latency_distributions(&self) -> Vec<LatencyDistributionV2>
Drain per-micro-function logarithmic latency distributions.
Sourcepub fn take_session_batch_routes(&self) -> Vec<BatchRouteV2>
pub fn take_session_batch_routes(&self) -> Vec<BatchRouteV2>
Drain completed batch-route records from this profiling runtime.
Sourcepub fn take_session_dropped_batch_routes(&self) -> u64
pub fn take_session_dropped_batch_routes(&self) -> u64
Drain the count of batch routes dropped after MAX_BATCH_ROUTES.
Sourcepub fn take_session_queue_links(
&self,
) -> (Vec<QueueLinkV2>, QueueLinkLossCounts)
pub fn take_session_queue_links( &self, ) -> (Vec<QueueLinkV2>, QueueLinkLossCounts)
Drain matched queue links in stable (queue, sequence) order with exact loss counts.
Sourcepub fn take_session_queue_depths(&self) -> Vec<QueueDepthV2>
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.
Sourcepub fn take_session_worker_imbalance(&self) -> WorkerImbalanceV2
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.
Sourcepub fn take_session_blocked_waits(&self) -> Vec<BlockedWaitRecordV2>
pub fn take_session_blocked_waits(&self) -> Vec<BlockedWaitRecordV2>
Drain blocked-wait records merged in sorted shard order.
Sourcepub fn take_session_stage_concurrency(&self) -> Vec<StageConcurrencyV2>
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.
Sourcepub fn take_session_worker_occupancy(&self) -> WorkerOccupancyV2
pub fn take_session_worker_occupancy(&self) -> WorkerOccupancyV2
Drain per-worker busy and blocked time merged in sorted shard order.
Sourcepub fn take_session_cache_effectiveness(&self) -> Vec<CacheEffectivenessV2>
pub fn take_session_cache_effectiveness(&self) -> Vec<CacheEffectivenessV2>
Drain reuse-cache hit and miss counts merged in sorted shard order.
Sourcepub fn take_session_retries(&self) -> Vec<RetryRecordV2>
pub fn take_session_retries(&self) -> Vec<RetryRecordV2>
Drain retry attempts by cause, merged in sorted shard order.
Sourcepub fn take_session_indexed_counters(&self) -> Vec<IndexedCounterRecordV2>
pub fn take_session_indexed_counters(&self) -> Vec<IndexedCounterRecordV2>
Drain indexed counter families merged in sorted shard order.