pub struct OffloadTelemetry { /* private fields */ }Expand description
Mutable, single-threaded offload telemetry collector.
Updates use saturating arithmetic for monotonic counters and durations. Resident bytes are set explicitly, and setting a new value updates the corresponding peak. Wrap this value in a mutex if multiple threads need to record into one collector.
Implementations§
Source§impl OffloadTelemetry
impl OffloadTelemetry
Sourcepub fn from_plan(plan: &OffloadPlan) -> Self
pub fn from_plan(plan: &OffloadPlan) -> Self
Creates a collector initialized with a validated plan’s byte totals.
Sourcepub fn set_planned_bytes(&mut self, planned_bytes: TierByteTotals)
pub fn set_planned_bytes(&mut self, planned_bytes: TierByteTotals)
Replaces the planned byte totals recorded by this collector.
Sourcepub fn set_resident_bytes(&mut self, tier: MemoryTier, bytes: u64)
pub fn set_resident_bytes(&mut self, tier: MemoryTier, bytes: u64)
Sets current resident bytes and updates the peak for tier.
Sourcepub fn set_resident_units(&mut self, tier: MemoryTier, units: usize)
pub fn set_resident_units(&mut self, tier: MemoryTier, units: usize)
Sets current resident units and updates the peak for tier.
Sourcepub fn record_transfer(
&mut self,
direction: TransferDirection,
bytes: u64,
duration: Duration,
)
pub fn record_transfer( &mut self, direction: TransferDirection, bytes: u64, duration: Duration, )
Records one completed transfer using saturating counter updates.
Sourcepub fn record_prefetch(&mut self, outcome: PrefetchOutcome)
pub fn record_prefetch(&mut self, outcome: PrefetchOutcome)
Records one completed prefetch request and its outcome.
Sourcepub fn record_tier_prefetch(
&mut self,
tier: MemoryTier,
outcome: PrefetchOutcome,
)
pub fn record_tier_prefetch( &mut self, tier: MemoryTier, outcome: PrefetchOutcome, )
Records a cache request both globally and for its target tier.
Sourcepub fn record_prefetch_stall(&mut self, duration: Duration)
pub fn record_prefetch_stall(&mut self, duration: Duration)
Records a demand stall while waiting for a prefetched unit.
Sourcepub fn record_eviction(&mut self, bytes: u64)
pub fn record_eviction(&mut self, bytes: u64)
Records one eviction using saturating counter updates.
Sourcepub fn record_tier_eviction(&mut self, tier: MemoryTier, bytes: u64)
pub fn record_tier_eviction(&mut self, tier: MemoryTier, bytes: u64)
Records an eviction both globally and for its source tier.
Sourcepub fn record_allocator_memory(&mut self, metrics: AllocatorMemoryMetrics)
pub fn record_allocator_memory(&mut self, metrics: AllocatorMemoryMetrics)
Records an allocator sample supplied by the selected backend.
Sourcepub fn record_process_metrics(&mut self, metrics: ProcessMetrics)
pub fn record_process_metrics(&mut self, metrics: ProcessMetrics)
Records an externally obtained process sample.
Sourcepub fn sample_process_metrics(&mut self)
pub fn sample_process_metrics(&mut self)
Updates process observations using the built-in optional sampler.
Sourcepub fn snapshot(&self) -> OffloadReport
pub fn snapshot(&self) -> OffloadReport
Returns an immutable point-in-time report.
Trait Implementations§
Source§impl Clone for OffloadTelemetry
impl Clone for OffloadTelemetry
Source§fn clone(&self) -> OffloadTelemetry
fn clone(&self) -> OffloadTelemetry
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more