pub struct TierStatus {
pub kind: TierKind,
pub capacity_bytes: u64,
pub used_bytes: u64,
pub target_ratio: f64,
}Expand description
Live utilization snapshot for a single storage tier.
Fields§
§kind: TierKindWhich tier this status belongs to.
capacity_bytes: u64Total capacity of the tier in bytes.
used_bytes: u64Number of bytes currently in use.
target_ratio: f64Desired utilization ratio in [0.0, 1.0].
Implementations§
Source§impl TierStatus
impl TierStatus
Sourcepub fn utilization(&self) -> f64
pub fn utilization(&self) -> f64
Returns the current utilization ratio (used / capacity).
Returns 0.0 when capacity_bytes is zero.
Sourcepub fn free_bytes(&self) -> u64
pub fn free_bytes(&self) -> u64
Returns the number of bytes still available (capacity - used),
saturating at zero.
Sourcepub fn is_over_target(&self) -> bool
pub fn is_over_target(&self) -> bool
Returns true when the tier is above its target utilization ratio.
Sourcepub fn excess_bytes(&self) -> u64
pub fn excess_bytes(&self) -> u64
Returns how many bytes exceed the target usage level.
When the tier is at or below its target the result is 0.
Trait Implementations§
Source§impl Clone for TierStatus
impl Clone for TierStatus
Source§fn clone(&self) -> TierStatus
fn clone(&self) -> TierStatus
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 TierStatus
impl RefUnwindSafe for TierStatus
impl Send for TierStatus
impl Sync for TierStatus
impl Unpin for TierStatus
impl UnsafeUnpin for TierStatus
impl UnwindSafe for TierStatus
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