pub struct StorageStats {
pub current_key_bytes: u64,
pub current_value_bytes: u64,
pub historical_key_bytes: u64,
pub historical_value_bytes: u64,
pub current_count: u64,
pub historical_count: u64,
pub cdc_key_bytes: u64,
pub cdc_value_bytes: u64,
pub cdc_count: u64,
}Expand description
Storage statistics for a single object or aggregate.
Tracks both “current” (latest MVCC version) and “historical” (older versions) separately to understand storage overhead from versioning.
Fields§
§current_key_bytes: u64Total bytes used by keys for latest versions
current_value_bytes: u64Total bytes used by values for latest versions
historical_key_bytes: u64Total bytes used by keys for older MVCC versions
historical_value_bytes: u64Total bytes used by values for older MVCC versions
current_count: u64Number of current (latest version) entries
historical_count: u64Number of historical (older version) entries
cdc_key_bytes: u64Total CDC key bytes attributed to this object
cdc_value_bytes: u64Total CDC value bytes attributed to this object
cdc_count: u64Number of CDC entries attributed to this object
Implementations§
Source§impl StorageStats
impl StorageStats
Sourcepub fn new() -> StorageStats
pub fn new() -> StorageStats
Create new empty stats.
Sourcepub fn total_bytes(&self) -> u64
pub fn total_bytes(&self) -> u64
Total bytes across current and historical data.
Sourcepub fn current_bytes(&self) -> u64
pub fn current_bytes(&self) -> u64
Total bytes for current (latest) data only.
Sourcepub fn historical_bytes(&self) -> u64
pub fn historical_bytes(&self) -> u64
Total bytes for historical (older) data only.
Sourcepub fn cdc_total_bytes(&self) -> u64
pub fn cdc_total_bytes(&self) -> u64
Total CDC bytes for this object.
Sourcepub fn total_count(&self) -> u64
pub fn total_count(&self) -> u64
Total entry count across current and historical.
Sourcepub fn record_cdc(&mut self, key_bytes: u64, value_bytes: u64, count: u64)
pub fn record_cdc(&mut self, key_bytes: u64, value_bytes: u64, count: u64)
Record CDC bytes for a change attributed to this object.
Sourcepub fn record_insert(&mut self, key_bytes: u64, value_bytes: u64)
pub fn record_insert(&mut self, key_bytes: u64, value_bytes: u64)
Record a new entry (insert of a key that didn’t exist).
Sourcepub fn record_update(
&mut self,
new_key_bytes: u64,
new_value_bytes: u64,
old_key_bytes: u64,
old_value_bytes: u64,
)
pub fn record_update( &mut self, new_key_bytes: u64, new_value_bytes: u64, old_key_bytes: u64, old_value_bytes: u64, )
Record an update (new version of existing key).
The old version moves from current to historical.
Sourcepub fn record_delete(
&mut self,
tombstone_key_bytes: u64,
old_key_bytes: u64,
old_value_bytes: u64,
)
pub fn record_delete( &mut self, tombstone_key_bytes: u64, old_key_bytes: u64, old_value_bytes: u64, )
Record a delete (tombstone for existing key).
The old version moves to historical, tombstone key added to historical.
Sourcepub fn record_drop(&mut self, key_bytes: u64, value_bytes: u64)
pub fn record_drop(&mut self, key_bytes: u64, value_bytes: u64)
Record a drop (physical removal of a historical version entry).
Unlike delete, drop doesn’t create tombstones - it physically removes entries from storage. Used for MVCC cleanup of old versions.
Trait Implementations§
Source§impl AddAssign for StorageStats
impl AddAssign for StorageStats
Source§fn add_assign(&mut self, rhs: StorageStats)
fn add_assign(&mut self, rhs: StorageStats)
+= operation. Read moreSource§impl Clone for StorageStats
impl Clone for StorageStats
Source§fn clone(&self) -> StorageStats
fn clone(&self) -> StorageStats
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for StorageStats
impl Debug for StorageStats
Source§impl Default for StorageStats
impl Default for StorageStats
Source§fn default() -> StorageStats
fn default() -> StorageStats
Source§impl PartialEq for StorageStats
impl PartialEq for StorageStats
impl Eq for StorageStats
impl StructuralPartialEq for StorageStats
Auto Trait Implementations§
impl Freeze for StorageStats
impl RefUnwindSafe for StorageStats
impl Send for StorageStats
impl Sync for StorageStats
impl Unpin for StorageStats
impl UnwindSafe for StorageStats
Blanket Implementations§
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.