Skip to main content

StoreMetrics

Struct StoreMetrics 

Source
pub struct StoreMetrics {
Show 20 fields pub total_blocks: u64, pub tier0_blocks: u64, pub tier1_blocks: u64, pub tier2_blocks: u64, pub tier3_blocks: u64, pub tier1_bytes: u64, pub tier2_bytes: u64, pub tier3_bytes: u64, pub total_reads: u64, pub total_writes: u64, pub total_evictions: u64, pub total_upgrades: u64, pub total_downgrades: u64, pub total_reconstructions: u64, pub total_checksum_failures: u64, pub total_compactions: u64, pub tier_flips_last_minute: f32, pub avg_score_tier1: f32, pub avg_score_tier2: f32, pub avg_score_tier3: f32,
}
Expand description

Aggregate metrics for the temporal tensor store.

All counters are monotonically increasing over the lifetime of the store. Gauge-style fields (e.g. tier0_blocks) reflect the current state.

Fields§

§total_blocks: u64

Total number of live blocks across all tiers.

§tier0_blocks: u64

Number of blocks in tier 0 (raw / uncompressed).

§tier1_blocks: u64

Number of blocks in tier 1 (hot, 8-bit).

§tier2_blocks: u64

Number of blocks in tier 2 (warm, 7/5-bit).

§tier3_blocks: u64

Number of blocks in tier 3 (cold, 3-bit).

§tier1_bytes: u64

Total stored bytes in tier 1.

§tier2_bytes: u64

Total stored bytes in tier 2.

§tier3_bytes: u64

Total stored bytes in tier 3.

§total_reads: u64

Cumulative read count.

§total_writes: u64

Cumulative write count.

§total_evictions: u64

Cumulative eviction count.

§total_upgrades: u64

Cumulative upgrade count.

§total_downgrades: u64

Cumulative downgrade count.

§total_reconstructions: u64

Cumulative reconstruction count.

§total_checksum_failures: u64

Cumulative checksum failure count.

§total_compactions: u64

Cumulative compaction count.

§tier_flips_last_minute: f32

Tier flips per block per minute over the last minute.

§avg_score_tier1: f32

Average score of tier 1 blocks.

§avg_score_tier2: f32

Average score of tier 2 blocks.

§avg_score_tier3: f32

Average score of tier 3 blocks.

Implementations§

Source§

impl StoreMetrics

Source

pub fn new() -> Self

Create a new zeroed metrics struct.

Source

pub fn compression_ratio(&self) -> f32

Compression ratio: raw f32 bytes / stored bytes.

Raw bytes are estimated as total_blocks * average_tensor_len * 4, but since we lack per-block tensor lengths here, we approximate with the tier-0 identity: each tier-0 block is already f32, so the stored bytes for tier 0 equal the raw bytes. The ratio is therefore:

(tier0_raw + tier1_raw + tier2_raw + tier3_raw) / total_stored_bytes

Because we don’t track raw bytes per tier at this level, we report total_stored_bytes / total_stored_bytes as a baseline and let callers that have richer context compute the true ratio. For a simple heuristic, we use the known compression ratios: tier1 ~4x, tier2 ~5.5x, tier3 ~10.67x.

Source

pub fn total_stored_bytes(&self) -> u64

Total stored bytes across all compressed tiers (1, 2, 3).

Tier 0 blocks are raw f32 and not tracked separately; callers can compute tier-0 bytes as tier0_blocks * tensor_len * 4 if needed.

Source

pub fn format_report(&self) -> String

Generate a human-readable multi-line status report.

Source

pub fn format_json(&self) -> String

Generate a JSON representation (no serde dependency).

Source

pub fn health_check(&self) -> StoreHealthStatus

Automated health assessment.

Trait Implementations§

Source§

impl Clone for StoreMetrics

Source§

fn clone(&self) -> StoreMetrics

Returns a duplicate 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 StoreMetrics

Source§

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

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

impl Default for StoreMetrics

Source§

fn default() -> StoreMetrics

Returns the “default value” for a type. Read more

Auto Trait Implementations§

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> 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.