Tombstone ratio for this segment.
(&self)
| 62 | impl 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 { |
no outgoing calls