Skip to main content

Metrics

Struct Metrics 

Source
pub struct Metrics {
Show 16 fields pub writes_total: AtomicU64, pub reads_total: AtomicU64, pub deletes_total: AtomicU64, pub cache_hits: AtomicU64, pub cache_misses: AtomicU64, pub wal_syncs: AtomicU64, pub context_assemblies: AtomicU64, pub mql_queries_parsed: AtomicU64, pub contradictions_detected: AtomicU64, pub beliefs_propagated: AtomicU64, pub speculative_hits: AtomicU64, pub speculative_misses: AtomicU64, pub write_latency_us_sum: AtomicU64, pub write_latency_count: AtomicU64, pub read_latency_us_sum: AtomicU64, pub read_latency_count: AtomicU64,
}
Expand description

Atomic counters for all MenteDB operations.

Fields§

§writes_total: AtomicU64

Total write operations.

§reads_total: AtomicU64

Total read operations.

§deletes_total: AtomicU64

Total delete operations.

§cache_hits: AtomicU64

Cache hits.

§cache_misses: AtomicU64

Cache misses.

§wal_syncs: AtomicU64

WAL sync operations.

§context_assemblies: AtomicU64

Context assembly operations.

§mql_queries_parsed: AtomicU64

MQL queries parsed.

§contradictions_detected: AtomicU64

Contradictions detected.

§beliefs_propagated: AtomicU64

Beliefs propagated.

§speculative_hits: AtomicU64

Speculative cache hits.

§speculative_misses: AtomicU64

Speculative cache misses.

§write_latency_us_sum: AtomicU64

Sum of write latencies in microseconds.

§write_latency_count: AtomicU64

Number of write latency samples.

§read_latency_us_sum: AtomicU64

Sum of read latencies in microseconds.

§read_latency_count: AtomicU64

Number of read latency samples.

Implementations§

Source§

impl Metrics

Source

pub fn new() -> Self

Create a new zeroed metrics instance.

Source

pub fn inc_writes(&self)

Increment writes counter.

Source

pub fn inc_reads(&self)

Increment reads counter.

Source

pub fn inc_deletes(&self)

Increment deletes counter.

Source

pub fn inc_cache_hits(&self)

Increment cache hits counter.

Source

pub fn inc_cache_misses(&self)

Increment cache misses counter.

Source

pub fn record_write_latency(&self, microseconds: u64)

Record a write latency sample.

Source

pub fn record_read_latency(&self, microseconds: u64)

Record a read latency sample.

Source

pub fn export_prometheus(&self) -> String

Export metrics in Prometheus text exposition format.

Source

pub fn export_json(&self) -> String

Export metrics as a JSON string.

Source

pub fn snapshot(&self) -> MetricsSnapshot

Take a point-in-time snapshot of all metrics.

Trait Implementations§

Source§

impl Default for Metrics

Source§

fn default() -> Self

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