Display disk usage of some directory tree as a flame graph.
This is a port of the files.pl script, which is part of the FlameGraph repository, to Rust.
Why?: No particular reason.
cargo install --git https://github.com/stephan-cr/fold_files.git
fold_files <directory> | perl flamegraph.pl --hash --countname=bytes --nametype=Directory: > out.svg
Alternatively, instead of the original Flamegraph implementation, Inferno might be used.
fold_files --buffered . | inferno-flamegraph --hash --countname=MB --nametype=Directory: --height 24 --factor $(( 1. / 1024 / 1024 )) > out.svg
Note: $(( 1. / 1024 / 1024 ))
is zsh
specific, bash has something similar, but won't work with floating
point numbers. Fish has
math
.
Same license as the original script, which is Apache License 2.0.