compsize icon indicating copy to clipboard operation
compsize copied to clipboard

Feature request: output only one value instead of a table

Open Forza-tng opened this issue 1 year ago • 2 comments

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

Forza-tng avatar Mar 25 '23 16:03 Forza-tng

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 :/

kilobyte avatar Apr 14 '23 05:04 kilobyte

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

Forza-tng avatar Apr 14 '23 06:04 Forza-tng