Skip to main content

DistribCacheMetrics

Struct DistribCacheMetrics 

Source
pub struct DistribCacheMetrics {
Show 50 fields pub cache_hits: AtomicU64, pub cache_misses: AtomicU64, pub cache_puts: AtomicU64, pub cache_evictions: AtomicU64, pub cache_invalidations: AtomicU64, pub l1_hits: AtomicU64, pub l1_misses: AtomicU64, pub l1_size_bytes: AtomicU64, pub l1_entries: AtomicU64, pub l2_hits: AtomicU64, pub l2_misses: AtomicU64, pub l2_size_bytes: AtomicU64, pub l2_entries: AtomicU64, pub l3_hits: AtomicU64, pub l3_misses: AtomicU64, pub l3_size_bytes: AtomicU64, pub l3_entries: AtomicU64, pub latency_under_100us: AtomicU64, pub latency_100us_1ms: AtomicU64, pub latency_1ms_10ms: AtomicU64, pub latency_10ms_100ms: AtomicU64, pub latency_over_100ms: AtomicU64, pub latency_total_us: AtomicU64, pub latency_count: AtomicU64, pub oltp_queries: AtomicU64, pub olap_queries: AtomicU64, pub vector_queries: AtomicU64, pub ai_agent_queries: AtomicU64, pub rag_queries: AtomicU64, pub mixed_queries: AtomicU64, pub conversation_cache_hits: AtomicU64, pub conversation_cache_misses: AtomicU64, pub rag_cache_hits: AtomicU64, pub rag_cache_misses: AtomicU64, pub tool_cache_hits: AtomicU64, pub tool_cache_misses: AtomicU64, pub semantic_cache_hits: AtomicU64, pub semantic_cache_misses: AtomicU64, pub prefetch_hits: AtomicU64, pub prefetch_misses: AtomicU64, pub prefetch_predictions: AtomicU64, pub wal_invalidations: AtomicU64, pub ttl_invalidations: AtomicU64, pub manual_invalidations: AtomicU64, pub scheduled_queries: AtomicU64, pub queued_queries: AtomicU64, pub rejected_queries: AtomicU64, pub cache_errors: AtomicU64, pub timeout_errors: AtomicU64, pub serialization_errors: AtomicU64, /* private fields */
}
Expand description

Comprehensive metrics for DistribCache

Fields§

§cache_hits: AtomicU64§cache_misses: AtomicU64§cache_puts: AtomicU64§cache_evictions: AtomicU64§cache_invalidations: AtomicU64§l1_hits: AtomicU64§l1_misses: AtomicU64§l1_size_bytes: AtomicU64§l1_entries: AtomicU64§l2_hits: AtomicU64§l2_misses: AtomicU64§l2_size_bytes: AtomicU64§l2_entries: AtomicU64§l3_hits: AtomicU64§l3_misses: AtomicU64§l3_size_bytes: AtomicU64§l3_entries: AtomicU64§latency_under_100us: AtomicU64§latency_100us_1ms: AtomicU64§latency_1ms_10ms: AtomicU64§latency_10ms_100ms: AtomicU64§latency_over_100ms: AtomicU64§latency_total_us: AtomicU64§latency_count: AtomicU64§oltp_queries: AtomicU64§olap_queries: AtomicU64§vector_queries: AtomicU64§ai_agent_queries: AtomicU64§rag_queries: AtomicU64§mixed_queries: AtomicU64§conversation_cache_hits: AtomicU64§conversation_cache_misses: AtomicU64§rag_cache_hits: AtomicU64§rag_cache_misses: AtomicU64§tool_cache_hits: AtomicU64§tool_cache_misses: AtomicU64§semantic_cache_hits: AtomicU64§semantic_cache_misses: AtomicU64§prefetch_hits: AtomicU64§prefetch_misses: AtomicU64§prefetch_predictions: AtomicU64§wal_invalidations: AtomicU64§ttl_invalidations: AtomicU64§manual_invalidations: AtomicU64§scheduled_queries: AtomicU64§queued_queries: AtomicU64§rejected_queries: AtomicU64§cache_errors: AtomicU64§timeout_errors: AtomicU64§serialization_errors: AtomicU64

Implementations§

Source§

impl DistribCacheMetrics

Source

pub fn new() -> Self

Create new metrics instance

Source

pub fn record_hit(&self, tier: CacheTier)

Record cache hit

Source

pub fn record_miss(&self, tier: CacheTier)

Record cache miss

Source

pub fn record_put(&self)

Record cache put

Source

pub fn record_eviction(&self)

Record eviction

Source

pub fn record_invalidation(&self, source: InvalidationSource)

Record invalidation

Source

pub fn record_latency(&self, duration: Duration)

Record latency

Source

pub fn record_workload(&self, workload: WorkloadType)

Record workload type

Source

pub fn update_tier_size(&self, tier: CacheTier, size_bytes: u64, entries: u64)

Update tier size

Source

pub fn record_error(&self, error_type: ErrorType)

Record error

Source

pub fn uptime(&self) -> Duration

Get uptime

Source

pub fn hit_rate(&self) -> f64

Get overall hit rate

Source

pub fn avg_latency_us(&self) -> f64

Get average latency in microseconds

Source

pub fn to_prometheus(&self) -> String

Export as Prometheus text format

Source

pub fn to_json(&self) -> Value

Export as JSON

Source

pub fn reset(&self)

Reset all metrics

Trait Implementations§

Source§

impl Debug for DistribCacheMetrics

Source§

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

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

impl Default for DistribCacheMetrics

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> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

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

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more