pub struct BlockTierRecord {
pub cid: String,
pub current_tier: StorageTier,
pub access_count: u64,
pub last_accessed: Instant,
pub size_bytes: u64,
pub created_at: Instant,
}Expand description
Per-block tracking record held inside StorageTierManager.
Fields§
§cid: StringContent identifier string for the block.
current_tier: StorageTierCurrent tier assignment.
access_count: u64Cumulative access count since the record was created.
last_accessed: InstantMonotonic timestamp of the most-recent access.
size_bytes: u64Block size in bytes (supplied by the caller on first access).
created_at: InstantMonotonic timestamp of record creation.
Implementations§
Source§impl BlockTierRecord
impl BlockTierRecord
Sourcepub fn access_rate_per_sec(&self, window: Duration) -> f64
pub fn access_rate_per_sec(&self, window: Duration) -> f64
Instantaneous access rate over the supplied measurement window.
Returns access_count / window.as_secs_f64(), or 0.0 if the window
has zero length (avoids division by zero).
Trait Implementations§
Source§impl Clone for BlockTierRecord
impl Clone for BlockTierRecord
Source§fn clone(&self) -> BlockTierRecord
fn clone(&self) -> BlockTierRecord
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for BlockTierRecord
impl RefUnwindSafe for BlockTierRecord
impl Send for BlockTierRecord
impl Sync for BlockTierRecord
impl Unpin for BlockTierRecord
impl UnsafeUnpin for BlockTierRecord
impl UnwindSafe for BlockTierRecord
Blanket Implementations§
impl<T> Allocation for T
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more