pub enum Metrics {
    Noop,
    Op(MetricsInner),
}
Expand description

Metrics is a snapshot of performance statistics for the lifetime of a cache instance.

Metrics promises thread-safe.

Variants

Noop

No operation metrics

Op(MetricsInner)

Op metrics

Implementations

Create a Noop metrics

Create a new op metrics

Return if the metrics is a Op metrics

Return if the metrics is Noop

Returns the number of Get calls where a value was found for the corresponding key.

Returns the number of Get calls where a value was not found for the corresponding key.

Returns the total number of Set calls where a new key-value item was added.

Returns the total number of Set calls where a new key-value item was updated.

Returns the total number of keys evicted.

Returns the sum of costs that have been added (successful Set calls).

Returns the sum of all costs that have been evicted.

Returns the number of Set calls that don’t make it into internal buffers (due to contention or some other reason).

Returns the number of Set calls rejected by the policy (TinyLFU).

Returns the number of Get counter increments that are dropped internally.

Returns the number of Get counter increments that are kept.

Ratio is the number of Hits over all accesses (Hits + Misses). This is the percentage of successful Get calls.

Returns the histogram data of this metrics

clear resets all the metrics

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

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

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. Read more

Converts the given value to a String. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.