Skip to main content

Module lvc

Module lvc 

Source
Expand description

Last Value Cache (LVC) — O(1) lookup of the most recent point per series.

The LVC stores the most recent Point for each series key, keyed by the full SeriesKey (measurement + tags). It is populated on every insert() and provides sub-microsecond lookups for dashboard-style “current value” queries.

Thread-safe via DashMap — lock-free concurrent reads and sharded writes.

§LRU Eviction

When max_entries > 0, the cache uses a HashMap<SeriesKey, usize> + doubly-linked intrusive list for O(1) LRU eviction. Previous implementation used VecDeque::retain() which was O(N) per update — a critical bottleneck at >100K series.

Structs§

LastValueCache
Last Value Cache — stores the most recent point per series.