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

Method tier_stats

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

Per-tier fragmentation statistics.

(&self)

Source from the content-addressed store, hash-verified

256
257 /// Per-tier fragmentation statistics.
258 pub fn tier_stats(&self) -> Vec<SlabTierStats> {
259 self.tiers
260 .iter()
261 .map(|t| SlabTierStats {
262 slot_size: t.slot_size,
263 total_slots: t.total_slots,
264 occupied_slots: t.occupied,
265 capacity_bytes: t.capacity_bytes(),
266 occupied_bytes: t.occupied_bytes(),
267 fragmentation_ratio: t.fragmentation_ratio(),
268 })
269 .collect()
270 }
271
272 /// Overall fragmentation ratio: capacity / used_bytes. 1.0 = perfect.
273 pub fn fragmentation_ratio(&self) -> f64 {

Callers 1

tier_stats_populatedFunction · 0.80

Calls 5

collectMethod · 0.80
capacity_bytesMethod · 0.80
occupied_bytesMethod · 0.80
fragmentation_ratioMethod · 0.80
iterMethod · 0.45

Tested by 1

tier_stats_populatedFunction · 0.64