MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / lru_eviction

Function lru_eviction

nodedb/src/engine/timeseries/recent_cache.rs:232–239  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

230
231 #[test]
232 fn lru_eviction() {
233 let mut cache = RecentWindowCache::new(500, 3_600_000);
234 cache.insert(T1, "m", make_partition(1000, 2000, 20)); // 320 bytes
235 cache.insert(T1, "m", make_partition(3000, 4000, 20)); // 320 bytes → evicts first
236 assert_eq!(cache.len(), 1);
237 assert!(cache.get(T1, "m", 1000).is_none());
238 assert!(cache.get(T1, "m", 3000).is_some());
239 }
240}

Callers

nothing calls this directly

Calls 2

make_partitionFunction · 0.85
insertMethod · 0.45

Tested by

no test coverage detected