pub struct CacheStats {
pub hits: u64,
pub misses: u64,
pub entries: usize,
pub peak_entries: usize,
pub evictions: u64,
}Expand description
Snapshot of one EGLImage cache’s hit/miss counters.
The counters themselves have always existed (logged at Drop); this
snapshot makes them assertable: steady-state tests capture stats after
warmup and after an N-frame loop and require misses to stay flat — any
increase means a convert re-imported a buffer it should have found cached,
which is the cache-behavior equality gate for GL refactors.
Fields§
§hits: u64§misses: u64§entries: usize§peak_entries: usizeHigh-water mark of entries.
Since entries are retained past the lifetime of the tensor that
produced them (the retention that CachedImport documents), each one
pins its buffer, so
occupancy — not hit rate — is what says how much memory a workload
holds. Below capacity this is the workload’s true working-set size,
and the number to size EDGEFIRST_EGL_CACHE_CAPACITY against.
It saturates at capacity, so on its own it cannot tell a
workload that exactly fits from one that is thrashing — both report
peak_entries == capacity. Read it together with evictions, which
is what distinguishes them.
evictions: u64Entries evicted to stay within capacity.
The signal that capacity is too small for the workload: every
eviction discards an import that is likely to be asked for again, so
a steady-state pipeline should reach zero. Nonzero-and-climbing with
peak_entries == capacity is thrashing — raise
EDGEFIRST_EGL_CACHE_CAPACITY, at the cost of pinning more buffers.
Trait Implementations§
Source§impl Clone for CacheStats
impl Clone for CacheStats
Source§fn clone(&self) -> CacheStats
fn clone(&self) -> CacheStats
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for CacheStats
Source§impl Debug for CacheStats
impl Debug for CacheStats
impl Eq for CacheStats
Source§impl PartialEq for CacheStats
impl PartialEq for CacheStats
impl StructuralPartialEq for CacheStats
Auto Trait Implementations§
impl Freeze for CacheStats
impl RefUnwindSafe for CacheStats
impl Send for CacheStats
impl Sync for CacheStats
impl Unpin for CacheStats
impl UnsafeUnpin for CacheStats
impl UnwindSafe for CacheStats
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
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 moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
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