Skip to main content

PoolStats

Struct PoolStats 

Source
pub struct PoolStats {
Show 18 fields pub imports_performed: u64, pub reused: u64, pub acquired: u64, pub released_to_pool: u64, pub released_dropped: u64, pub drains: u64, pub drained: u64, pub fresh_import_refusals: u64, pub rss_samples: u64, pub rss_samples_unavailable: u64, pub key_hits: u64, pub key_misses: u64, pub distinct_keys_seen: u64, pub fresh_imports_avoided: u64, pub miss_empty_pool: u64, pub miss_reuse_disabled: u64, pub miss_no_matching_key: u64, pub last_miss_reason: Option<SessionPoolKeyMissReason>,
}
Expand description

Cumulative metrics for one SessionPool.

Snapshot via SessionPool::stats. Counters never reset—to compute a delta, take two snapshots and subtract.

imports_performed + reused == acquired by construction: every SessionPool::acquire call increments acquired exactly once plus either imports_performed (cache miss) or reused (cache hit). Similarly, released_to_pool + released_dropped counts every PooledSession::drop firing. released_to_pool is cumulative: an entry counted there may later be removed by SessionPool::drain, which records the removal in drained.

Fields§

§imports_performed: u64

Number of fresh Lean.importModules calls performed because no pooled environment matched the requested imports list.

§reused: u64

Number of acquire calls that found a matching pooled environment and reused it instead of re-importing.

§acquired: u64

Total acquire calls (== imports_performed + reused).

§released_to_pool: u64

Number of release events that pushed the environment back onto the free list.

§released_dropped: u64

Number of release events that dropped the environment because the pool was at capacity.

§drains: u64

Number of explicit SessionPool::drain calls.

§drained: u64

Number of cached environments dropped by explicit drains.

§fresh_import_refusals: u64

Number of fresh imports refused by SessionPoolMemoryPolicy.

§rss_samples: u64

Number of process RSS samples taken before fresh imports.

§rss_samples_unavailable: u64

Number of process RSS samples that were unavailable.

§key_hits: u64

Number of acquire calls that matched a reusable session key.

§key_misses: u64

Number of acquire calls that could not reuse a session key.

§distinct_keys_seen: u64

Number of distinct session keys observed by this pool.

§fresh_imports_avoided: u64

Number of fresh imports avoided by key hits.

§miss_empty_pool: u64

Key misses because the pool had no reusable entry.

§miss_reuse_disabled: u64

Key misses because the pool has zero reuse capacity.

§miss_no_matching_key: u64

Key misses because cached entries existed but none matched the requested key.

§last_miss_reason: Option<SessionPoolKeyMissReason>

Most recent key-miss reason.

Trait Implementations§

Source§

impl Clone for PoolStats

Source§

fn clone(&self) -> PoolStats

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 Copy for PoolStats

Source§

impl Debug for PoolStats

Source§

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

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

impl Default for PoolStats

Source§

fn default() -> PoolStats

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

impl Eq for PoolStats

Source§

impl PartialEq for PoolStats

Source§

fn eq(&self, other: &PoolStats) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for PoolStats

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