pub struct LeidenCache {
pub commit_latency_ms: VecDeque<u64>,
pub last_recompute_at: Option<Instant>,
pub commit_arrivals: VecDeque<Instant>,
pub default_mode: LeidenMode,
pub storm_cap_per_min: u32,
}Expand description
Gap 10 Phase-1 debounce + storm-cap state.
Fields§
§commit_latency_ms: VecDeque<u64>Rolling ring of commit wall-clock latencies (milliseconds).
last_recompute_at: Option<Instant>Instant of the most recent successful full recompute.
commit_arrivals: VecDeque<Instant>Ring of commit arrivals inside the trailing 60s.
default_mode: LeidenModeDefault mode at process start.
storm_cap_per_min: u32Effective storm cap (operator-overridable).
Implementations§
Source§impl LeidenCache
impl LeidenCache
Sourcepub fn observe_commit_latency(&mut self, latency: Duration)
pub fn observe_commit_latency(&mut self, latency: Duration)
Record a completed-commit wall-time sample.
Sourcepub fn observe_commit_arrival(&mut self, at: Instant)
pub fn observe_commit_arrival(&mut self, at: Instant)
Record a commit arrival; evicts entries older than 60s.
Sourcepub fn rolling_p75_commit_ms(&self) -> Option<u64>
pub fn rolling_p75_commit_ms(&self) -> Option<u64>
Nearest-rank p75 of the rolling commit-latency ring.
Sourcepub fn effective_debounce_ms(&self) -> u64
pub fn effective_debounce_ms(&self) -> u64
Effective debounce window via derive_debounce_ms.
Sourcepub fn storm_cap_reached(&self) -> bool
pub fn storm_cap_reached(&self) -> bool
Is the 60s commit-arrival ring at or above the storm cap?
Sourcepub fn select_mode(&self, node_count: usize, now: Instant) -> LeidenMode
pub fn select_mode(&self, node_count: usize, now: Instant) -> LeidenMode
Pure policy function. Returns the mode to serve this call.
Trait Implementations§
Source§impl Debug for LeidenCache
impl Debug for LeidenCache
Auto Trait Implementations§
impl Freeze for LeidenCache
impl RefUnwindSafe for LeidenCache
impl Send for LeidenCache
impl Sync for LeidenCache
impl Unpin for LeidenCache
impl UnsafeUnpin for LeidenCache
impl UnwindSafe for LeidenCache
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
Mutably borrows from an owned value. Read more