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: u64The number of live objects stored in the backing storage files.
stored_objects: u64The total number of (potentially duplicated) objects stored in the backing storage files.
dead_objects: u64The number of dead objects that have been replaced or removed in other storage files, contributing to fragmentation.
live_ratio: f32The ratio of all objects on disk that are live to all objects in total. This is another way of expressing fragmentation.
files: usizeThe number of backing storage files that exist and are being held open.
total_file_size: u64The sum of the sizes of all files currently on-disk.
bytes_read: u64The number of bytes that have been read since
this instance of Marble was recovered.
bytes_written: u64The 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: u64This is the number of bytes that are written from user
calls to crate::Marble::write_batch since this instance
was recovered.
write_amplification: f32The 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: f32The 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.