pub struct CacheResidencyTelemetry {
pub report: CacheResidencyReport,
/* private fields */
}Expand description
Backend-neutral collector for bounded cache activity and snapshot assembly.
Backends update the aggregate report while inspecting their native storage,
then provide exact current per-layer totals to Self::finalize_snapshot.
Historical layer identities and overflow accounting remain runtime-owned.
Fields§
§report: CacheResidencyReportAggregate current and cumulative report fields.
Implementations§
Source§impl CacheResidencyTelemetry
impl CacheResidencyTelemetry
Sourcepub fn new(queue_capacity: usize) -> Self
pub fn new(queue_capacity: usize) -> Self
Creates an empty collector with the effective I/O queue capacity.
Sourcepub fn layer_activity_mut(
&mut self,
global_layer: usize,
) -> &mut CacheLayerResidencyStats
pub fn layer_activity_mut( &mut self, global_layer: usize, ) -> &mut CacheLayerResidencyStats
Returns cumulative activity storage for one identified layer.
The first bounded set of layer identities remains stable for the life of the collector. Later identities are folded into an exact overflow row.
Sourcepub fn unassigned_activity_mut(&mut self) -> &mut CacheLayerResidencyStats
pub fn unassigned_activity_mut(&mut self) -> &mut CacheLayerResidencyStats
Returns cumulative activity storage for work without a layer identity.
Sourcepub fn finalize_snapshot(
&mut self,
current: BTreeMap<usize, CacheLayerResidencyStats>,
device_budget_bytes: u64,
host_budget_bytes: u64,
disk_budget_bytes: Option<u64>,
)
pub fn finalize_snapshot( &mut self, current: BTreeMap<usize, CacheLayerResidencyStats>, device_budget_bytes: u64, host_budget_bytes: u64, disk_budget_bytes: Option<u64>, )
Merges exact current per-layer totals with cumulative runtime activity.
Peak aggregate fields advance only when current usage is within the configured limit, matching successful-admission semantics.