Get nodes with access count below `threshold` (cold nodes).
(&self, threshold: u32)
| 20 | |
| 21 | /// Get nodes with access count below `threshold` (cold nodes). |
| 22 | pub fn cold_nodes(&self, threshold: u32) -> Vec<u32> { |
| 23 | self.access_counts |
| 24 | .iter() |
| 25 | .enumerate() |
| 26 | .filter(|(_, c)| c.get() <= threshold) |
| 27 | .map(|(i, _)| i as u32) |
| 28 | .collect() |
| 29 | } |
| 30 | |
| 31 | /// Number of hot nodes (access count > 0). |
| 32 | pub fn hot_node_count(&self) -> usize { |