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

Function tier_stats_populated

nodedb/src/engine/kv/slab.rs:471–481  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

469
470 #[test]
471 fn tier_stats_populated() {
472 let mut slab = SlabAllocator::new();
473 slab.alloc(b"small"); // 64B tier
474 slab.alloc(&[0; 200]); // 256B tier
475
476 let stats = slab.tier_stats();
477 assert_eq!(stats.len(), TIER_SIZES.len());
478 assert_eq!(stats[0].occupied_slots, 1); // 64B tier
479 assert_eq!(stats[2].occupied_slots, 1); // 256B tier
480 assert_eq!(stats[1].occupied_slots, 0); // 128B tier unused
481 }
482
483 #[test]
484 fn used_bytes_and_capacity() {

Callers

nothing calls this directly

Calls 2

tier_statsMethod · 0.80
allocMethod · 0.45

Tested by

no test coverage detected