Struct Stats

Source
pub struct Stats {
    pub live_objects: u64,
    pub stored_objects: u64,
    pub dead_objects: u64,
    pub live_ratio: f32,
    pub files: usize,
    pub total_file_size: u64,
    pub bytes_read: u64,
    pub bytes_written: u64,
    pub high_level_user_bytes_written: u64,
    pub write_amplification: f32,
    pub space_amplification: f32,
}
Expand description

Statistics for file contents, to base decisions around calls to maintenance.

Fields§

§live_objects: u64

The number of live objects stored in the backing storage files.

§stored_objects: u64

The total number of (potentially duplicated) objects stored in the backing storage files.

§dead_objects: u64

The number of dead objects that have been replaced or removed in other storage files, contributing to fragmentation.

§live_ratio: f32

The ratio of all objects on disk that are live to all objects in total. This is another way of expressing fragmentation.

§files: usize

The number of backing storage files that exist and are being held open.

§total_file_size: u64

The sum of the sizes of all files currently on-disk.

§bytes_read: u64

The number of bytes that have been read since this instance of Marble was recovered.

§bytes_written: u64

The number of bytes that have been written due to calls to both write_batch and rewrites caused by calls to maintenance since this instance of Marble was recovered.

§high_level_user_bytes_written: u64

This is the number of bytes that are written from user calls to crate::Marble::write_batch since this instance was recovered.

§write_amplification: f32

The ratio of all bytes written to high-level user data since this instance of Marble was recovered. This is basically the maintenance overhead of on-disk GC in response to objects being rewritten and defragmentation maintenance copying old data to new homes. 1.0 is “perfect”. If all data needs to be copied once, this will be 2.0, etc… For reference, many LSM tries will see write amplifications of a few dozen, and b-trees can often see write amplifications of several hundred. So, if you’re under 10 for serious workloads, you’re doing much better than most industrial systems.

§space_amplification: f32

The ratio of the sum of the size of all bytes written to the sum of the size of all high-level user data written since this instance of Marble was recovered. This goes up with fragmentation, and is brought back down with calls to maintenance that defragment storage files.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Stats

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Stats

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for Stats

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnwindSafe for Stats

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.