pub struct TinyLfuConfig {
pub sketch_bytes: Option<usize>,
pub promotion_threshold: Option<u32>,
pub probation_target_pct: Option<u64>,
pub aging_halflife_sec: Option<u64>,
}Expand description
W-TinyLFU tuning knobs (ADR 040). See CacheConfig::tinylfu.
Fields§
§sketch_bytes: Option<usize>Count-min sketch size in bytes, shared by admission and eviction.
Absent => crate::config::DEFAULT_TINYLFU_SKETCH_BYTES (262144).
Larger sketches reduce frequency-estimate collisions at the cost of
more resident memory.
promotion_threshold: Option<u32>Prior sightings a probation member needs before promotion to the main
segment. Absent => crate::config::DEFAULT_TINYLFU_PROMOTION_THRESHOLD
(2).
probation_target_pct: Option<u64>Percent of cache.cache_size_mb the probation segment is capped to.
Absent => crate::config::DEFAULT_TINYLFU_PROBATION_TARGET_PCT (10).
Hard bounds [1, 50].
aging_halflife_sec: Option<u64>Reserved: half-life in seconds for aging the frequency sketch. Absent
=> crate::config::DEFAULT_TINYLFU_AGING_HALFLIFE_SEC (600).
Currently resolved and stored but not consulted — the shipped sketch
ages on a fixed observation-count window rather than a wall-clock
half-life.
Trait Implementations§
Source§impl Debug for TinyLfuConfig
impl Debug for TinyLfuConfig
Source§impl Default for TinyLfuConfig
impl Default for TinyLfuConfig
Source§impl<'de> Deserialize<'de> for TinyLfuConfig
impl<'de> Deserialize<'de> for TinyLfuConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for TinyLfuConfig
impl RefUnwindSafe for TinyLfuConfig
impl Send for TinyLfuConfig
impl Sync for TinyLfuConfig
impl Unpin for TinyLfuConfig
impl UnsafeUnpin for TinyLfuConfig
impl UnwindSafe for TinyLfuConfig
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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