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

Function metrics_counting

nodedb-bridge/src/buffer.rs:441–453  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

439
440 #[test]
441 fn metrics_counting() {
442 let (mut tx, mut rx) = RingBuffer::channel::<u64>(8);
443
444 for i in 0..5 {
445 tx.try_push(i).unwrap();
446 }
447 assert_eq!(tx.metrics().pushes(), 5);
448
449 for _ in 0..3 {
450 rx.try_pop().unwrap();
451 }
452 assert_eq!(rx.metrics().pops(), 3);
453 }
454}

Callers

nothing calls this directly

Calls 2

try_pushMethod · 0.80
try_popMethod · 0.80

Tested by

no test coverage detected