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

Function bytes_written_counter_increments

nodedb-wal/src/double_write.rs:678–698  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

676
677 #[test]
678 fn bytes_written_counter_increments() {
679 let dir = tempfile::tempdir().unwrap();
680 let dwb_path = dir.path().join("counter.dwb");
681 let before = wal_dwb_bytes_written_total();
682
683 let mut dwb = open_buffered(&dwb_path);
684 let rec = WalRecord::new(
685 RecordType::Put as u32,
686 1,
687 1,
688 0,
689 0,
690 b"counted".to_vec(),
691 None,
692 None,
693 )
694 .unwrap();
695 dwb.write_record(&rec).unwrap();
696
697 assert!(wal_dwb_bytes_written_total() > before);
698 }
699}

Callers

nothing calls this directly

Calls 6

open_bufferedFunction · 0.85
joinMethod · 0.80
write_recordMethod · 0.80
pathMethod · 0.45
to_vecMethod · 0.45

Tested by

no test coverage detected