#[derive(Debug, Clone, Default)]
pub struct ScannerStats {
pub zero_copy_borrows: u64,
pub heap_allocations: u64,
pub bytes_scanned: u64,
pub hint_hits: u64,
pub hint_misses: u64,
}
impl ScannerStats {
pub fn hint_hit_rate(&self) -> Option<f64> {
let total = self.hint_hits + self.hint_misses;
if total == 0 { None } else { Some(self.hint_hits as f64 / total as f64) }
}
pub fn zero_copy_rate(&self) -> Option<f64> {
let total = self.zero_copy_borrows + self.heap_allocations;
if total == 0 { None } else { Some(self.zero_copy_borrows as f64 / total as f64) }
}
}