Hi Tim, On 01/18/2017 01:38 AM, Tim Walberg wrote: > I really like the new release. It's definitely nice to have the added colors.
Yay. > Just one major request I would have - bring the linear option back. The > hilbert output is cool for a single device, and is ok for a two-device file > system, but it's not so easy to interpret especially when you have an odd > number of devices in your file system - I have a 3-device RAID-1 config. Ok, so because the curve continues its path and it may switch to a new device somewhere, you don't see clearly where the new device starts (there are also no extra helping lines / device borders). > An > alternative would be the ability to create separate maps for each device in > a file system, either by selecting a devid via command line, or by creating > individual images arranged in an array or something. That was one thing I > could do with the original version that had a separate script for dumping > the block groups and another for creating the PNG - I could filter the block > group list by devid to do individual images. Have a look at the scripting howto, linked from the main README somewhere at the bottom of the page: https://github.com/knorrie/btrfs-heatmap/blob/master/doc/scripting.md One of the examples, 2.3 [..] separate image per device [..] is an example of how to do this. It involves a little bit of scripting, but gives total flexibility of whatever you want to do. fs = btrfs.FileSystem('/foo') for device in fs.devices(): grid = heatmap.walk_dev_extents(fs, [device]) grid.write_png('device_%s.png' % device.devid) The first half of the page explains the params you can give to heatmap.walk_dev_extents, like also order and size etc. Stitching the resulting images together in whatever form is up to you, using your favourite image processing tools afterwards. > Thanks for all the work that's gone into this so far! Thanks! Check out (wip) branch linear: https://github.com/knorrie/btrfs-heatmap/commits/linear There's a commit which puts linear and snake mode in, besides the default hilbert (with --curve linear etc, like there was before). It's just taking another route walking the grid. :) The biggest problem with linear / snake is that it destroys the idea of locality (long lines instead of little blocks of data together), and when changing orders, it makes the same real point move around instead of staying at the same spot. See https://www.youtube.com/watch?v=DuiryHHTrjU&t=5m18s (->7m8s) for a visual explanation. Compare attached: - hilbert-order-8-size-9.png (bytes_per_pixel 41943040) - linear-order-8-size-9.png (bytes_per_pixel 41943040) To get a bit of a usable result, I need to lower the resolution of the image drastically, resulting in... - linear-order-6-size-9.png (bytes_per_pixel 671088640) ... with 640MiB crammed into a pixel instead of only 40MiB The result is that usage gets blurred out too much, because block group boundaries are too different from pixel boundaries. But, being able to play around with it is fun and serves a purpose, so I'll put this back in, and write a nice subpage of the README with some pictures of this kind to explain. o/ -- Hans van Kranenburg