Print total node count in -Z hir-stats
This commit is contained in:
parent
8adb4b30f4
commit
12eaa3ab84
3 changed files with 12 additions and 5 deletions
|
@ -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}");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue