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

Function evicts_at_capacity

nodedb/src/event/cdc/buffer.rs:309–325  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

307
308 #[test]
309 fn evicts_at_capacity() {
310 let buf = StreamBuffer::new(
311 "test".into(),
312 RetentionConfig {
313 max_events: 3,
314 max_age_secs: 3600,
315 },
316 );
317
318 for i in 1..=5 {
319 buf.push(make_event(i, i * 10));
320 }
321
322 assert_eq!(buf.len(), 3);
323 assert_eq!(buf.earliest_lsn(), Some(30));
324 assert_eq!(buf.total_evicted(), 2);
325 }
326
327 #[test]
328 fn read_from_lsn_with_limit() {

Callers

nothing calls this directly

Calls 2

make_eventFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected