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

Method used_bytes

nodedb/src/engine/kv/slab.rs:247–255  ·  view source on GitHub ↗

Total bytes actively in use.

(&self)

Source from the content-addressed store, hash-verified

245
246 /// Total bytes actively in use.
247 pub fn used_bytes(&self) -> usize {
248 let slab: usize = self.tiers.iter().map(|t| t.occupied_bytes()).sum();
249 let large: usize = self
250 .large_objects
251 .iter()
252 .filter_map(|o| o.as_ref().map(|lo| lo.data.len()))
253 .sum();
254 slab + large
255 }
256
257 /// Per-tier fragmentation statistics.
258 pub fn tier_stats(&self) -> Vec<SlabTierStats> {

Callers 1

fragmentation_ratioMethod · 0.80

Calls 5

sumMethod · 0.80
occupied_bytesMethod · 0.80
iterMethod · 0.45
as_refMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected