Btrfs-progs: add a bunch of new statistics to btrfs-calc-size
I've been wanting to get back to the allocator and make some changes to try and
fix our fragmenation woes with lots of metadata. But in order to make these
changes I need to have something to tell me if my changes are making a real
measurable difference. So this patch adds a bunch of new statistics to
btrfs-calc-size. It will tell me how long it took to read in the trees, how
many seeks it had (both forward and backward). It will tell me how far spread
out the tree is and spit out a nice histogram of the seeks. Here is some sample
output
Calculating size of extent tree
Total size: 60.74MB
Inline data: 0.00
Total seeks: 5020
Forward seeks: 3691
Backward seeks: 1329
Avg seek len: 929.53MB
Seek histogram
4096 - 4096: 1043 ####
8192 - 73728: 760 ###
81920 -
52527104: 753 ###
53518336 -
168009728: 753 ###
168591360 -
696045568: 753 ###
696238080 -
7560364032: 753 ###
7560437760 -
8409739264: 178 |
Total clusters: 1874
Avg cluster size: 25.17KB
Min cluster size: 8.00KB
Max cluster size: 472.00KB
Total disk spread: 7.90GB
Total read time: 0 s 341670 us
Levels: 4
This way we can have good numbers to back up any changes we make to the
allocator. Thanks,
Signed-off-by: Josef Bacik <jbacik@fusionio.com>
Signed-off-by: David Sterba <dsterba@suse.cz>
Signed-off-by: Chris Mason <chris.mason@fusionio.com>