Per-tier fragmentation statistics.
(&self)
| 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 { |