Skip to main content

Stats

Struct Stats 

Source
#[non_exhaustive]
pub struct Stats { pub handle_count: u64, pub total_pages: u64, pub file_size_bytes: u64, pub spillway_logical_bytes: Option<u64>, pub spillway_max_bytes: Option<u64>, }
Expand description

Read-only summary of database size/usage. Populated by the transaction manager; no methods here because there are no invariants to enforce.

I36 (ISSUES.md, 2026-05-22): #[non_exhaustive] so adding a fifth summary field (e.g. live-handle/total-handle ratio for retirement pressure) is not a breaking change. The companion ChiselCounters has carried the same attribute since the bench-suite series landed.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§handle_count: u64

Number of live handles (u64 ids currently mapped in the handle table).

§total_pages: u64

Total allocated pages in the file, matching Superblock.total_pages.

§file_size_bytes: u64

Raw size of the database file on disk. May exceed total_pages * PAGE_SIZE when a previous crash left orphan pages in the file tail — the last-durable superblock’s total_pages is authoritative, anything beyond it is dead weight that the next allocation will overwrite (see I4). Chisel is single-writer, so there is no concurrent commit that could cause a transient divergence.

§spillway_logical_bytes: Option<u64>

I74 (ISSUES.md, 2026-05-22): current spillway logical-bytes in flight (PAGE_SIZE × LIVE resident spilled pages — a page read back and respilled within a transaction is not double-counted). None when the spillway has never been opened — it is lazily constructed on the first overflow spill, so None means “no overflow has happened yet on this handle.” Some(0) means “spillway exists but is empty (just truncated by commit / rollback).” The distinction matters for monitoring: a long-lived None says “this workload fits comfortably in cache,” whereas Some(0) says “we have spilled before, might again.”

§spillway_max_bytes: Option<u64>

I74: the spillway’s max_bytes cap. Same None-vs-Some(0) distinction as spillway_logical_bytes. Operators predict SpillwayFull by watching spillway_logical_bytes / spillway_max_bytes climb across commits.

Trait Implementations§

Source§

impl Clone for Stats

Source§

fn clone(&self) -> Stats

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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

Auto Trait Implementations§

§

impl Freeze for Stats

§

impl RefUnwindSafe for Stats

§

impl Send for Stats

§

impl Sync for Stats

§

impl Unpin for Stats

§

impl UnsafeUnpin 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> Same for T

Source§

type Output = T

Should always be Self
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.