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

Function gap_detection

nodedb/src/event/consumer.rs:454–466  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

452
453 #[test]
454 fn gap_detection() {
455 let metrics = CoreMetrics::new();
456 let e1 = make_event(1);
457 let e5 = make_event(5);
458
459 record_event(0, &e1, &metrics);
460 detect_sequence_gap(0, &e5, 1, &metrics);
461 record_event(0, &e5, &metrics);
462
463 use std::sync::atomic::Ordering;
464 assert_eq!(metrics.events_processed.load(Ordering::Relaxed), 2);
465 assert_eq!(metrics.events_dropped.load(Ordering::Relaxed), 3);
466 }
467
468 #[tokio::test]
469 async fn consumer_processes_and_persists_watermark() {

Callers

nothing calls this directly

Calls 3

record_eventFunction · 0.85
detect_sequence_gapFunction · 0.85
make_eventFunction · 0.70

Tested by

no test coverage detected