1
Fork 0

Print total node count in -Z hir-stats

This commit is contained in:
Sam Estep 2024-11-13 23:19:47 -05:00
parent 8adb4b30f4
commit 12eaa3ab84
3 changed files with 12 additions and 5 deletions

View file

@ -126,6 +126,7 @@ impl<'k> StatCollector<'k> {
});
let total_size = nodes.iter().map(|(_, node)| node.stats.count * node.stats.size).sum();
let total_count = nodes.iter().map(|(_, node)| node.stats.count).sum();
eprintln!("{prefix} {title}");
eprintln!(
@ -167,7 +168,13 @@ impl<'k> StatCollector<'k> {
}
}
eprintln!("{prefix} ----------------------------------------------------------------");
eprintln!("{} {:<18}{:>10}", prefix, "Total", to_readable_str(total_size));
eprintln!(
"{} {:<18}{:>10} {:>14}",
prefix,
"Total",
to_readable_str(total_size),
to_readable_str(total_count),
);
eprintln!("{prefix}");
}
}