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

Method tombstone_ratio

nodedb/src/storage/compaction.rs:64–71  ·  view source on GitHub ↗

Tombstone ratio for this segment.

(&self)

Source from the content-addressed store, hash-verified

62impl SegmentMeta {
63 /// Tombstone ratio for this segment.
64 pub fn tombstone_ratio(&self) -> f64 {
65 let total = self.live_entries + self.tombstone_entries;
66 if total == 0 {
67 0.0
68 } else {
69 self.tombstone_entries as f64 / total as f64
70 }
71 }
72
73 /// Whether this segment needs compaction (high tombstone ratio).
74 pub fn needs_compaction(&self, threshold: f64) -> bool {

Callers 2

needs_compactionMethod · 0.45
tombstone_ratioFunction · 0.45

Calls

no outgoing calls

Tested by 1

tombstone_ratioFunction · 0.36