pub struct StorageMetrics {
pub sled_bytes_used: u64,
pub sled_bytes_free: u64,
pub wal_pending_ops: u64,
pub orphan_block_count: u64,
pub orphan_block_bytes: u64,
pub hot_tier_bytes: u64,
pub warm_tier_bytes: u64,
pub cold_tier_bytes: u64,
pub sstable_count: u64,
pub fragmentation_ratio: f64,
}Expand description
A snapshot of current storage system metrics used to drive advisory logic.
Fields§
§sled_bytes_used: u64Bytes currently used in the sled database.
sled_bytes_free: u64Bytes currently free in the sled database.
wal_pending_ops: u64Number of WAL operations that have not yet been flushed.
orphan_block_count: u64Number of blocks with no live references (orphans).
orphan_block_bytes: u64Total bytes occupied by orphan blocks.
hot_tier_bytes: u64Bytes stored in the hot tier.
warm_tier_bytes: u64Bytes stored in the warm tier.
cold_tier_bytes: u64Bytes stored in the cold tier.
sstable_count: u64Number of SSTable files currently present.
fragmentation_ratio: f64Fragmentation ratio in the range 0.0–1.0 (higher = more fragmented).
Implementations§
Source§impl StorageMetrics
impl StorageMetrics
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Returns the total bytes across all tiers plus sled.
Sourcepub fn usage_ratio(&self) -> f64
pub fn usage_ratio(&self) -> f64
Returns the usage ratio (used / (used + free)).
Returns 0.0 when both used and free are zero.
Trait Implementations§
Source§impl Clone for StorageMetrics
impl Clone for StorageMetrics
Source§fn clone(&self) -> StorageMetrics
fn clone(&self) -> StorageMetrics
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 moreSource§impl Debug for StorageMetrics
impl Debug for StorageMetrics
Source§impl<'de> Deserialize<'de> for StorageMetrics
impl<'de> Deserialize<'de> for StorageMetrics
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StorageMetrics
impl PartialEq for StorageMetrics
Source§fn eq(&self, other: &StorageMetrics) -> bool
fn eq(&self, other: &StorageMetrics) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for StorageMetrics
impl Serialize for StorageMetrics
impl StructuralPartialEq for StorageMetrics
Auto Trait Implementations§
impl Freeze for StorageMetrics
impl RefUnwindSafe for StorageMetrics
impl Send for StorageMetrics
impl Sync for StorageMetrics
impl Unpin for StorageMetrics
impl UnsafeUnpin for StorageMetrics
impl UnwindSafe for StorageMetrics
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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