Skip to main content

Module slot_observations

Module slot_observations 

Source
Expand description

Storage-slot change-frequency tracking and freshness heuristics.

To decide which cached storage slots can be reused and which must be re-fetched, this module records how often each observed slot changes over time. Slots that change frequently are rechecked sooner; stable slots are trusted longer (subject to a maximum age). The observations are persisted to disk so the heuristics survive across runs.

§Clock-agnostic

The tracker does not read the wall clock itself: callers pass now (in clock units) into observe and should_refetch, and the thresholds live in a crate::freshness::FreshnessParams. This lets the freshness controller drive the tracker from either a block clock or a wall clock.

Structs§

SlotObservation
Per-slot observation record, persisted to disk.
SlotObservationTracker
Tracks per-slot change frequency to drive intelligent purge decisions.