kilobyte / compsize

btrfs: find compression type/ratio on a file or set of files
Other
343 stars 23 forks source link

Feature request: output only one value instead of a table #49

Open Forza-tng opened 1 year ago

Forza-tng commented 1 year ago

When looking at the size of subvolumes and snapshots, I usually only want to look at the actual disk usage for the chosen set.

Example:

Instead of

# compsize foo
Processed 2778793 files, 79568 regular extents (1461600 refs), 1612739 inline.
Type       Perc     Disk Usage   Uncompressed Referenced
TOTAL       45%      3.5G         7.6G          96G
none       100%      1.9G         1.9G          29G
zstd        27%      1.5G         5.7G          67G
# compsize --disk-usage foo
3.5G

Ultimately it would be nice to print a table for the chosen set, similar to what btrfs fi du -s does.

# compsize --disk-usage foo bar 
Size      Path
---------------
3.5G      foo
4.1G      bar
# compsize --summary --disk-usage foo bar 
Size      Path
---------------
3.5G      foo
4.1G      bar
---------------
7.6G      TOTAL
kilobyte commented 1 year ago

There's, at present, no disk usage known for individual items. Measuring it would require calculating the set of extents referenced by the current item, rather that by all items processed. Doing so is of course not hard; cost: no extra I/O, double the current memory.

Outputting a single field needs only a trivial amount of tuits; it's just that my field of them is barren these days :/

Forza-tng commented 1 year ago

From my point of view, it would be enough to show only the apparent size of the selected set, like how compsize works today.