First install compsize.
In Debian/Ubuntu:
apt install btrfs-compsize
In Fedora:
dnf install compsize
Then run it on your filesystem.
Add -x if you don't want to cross into other subvolumes or filesystems.
You must add -x if you have non-btrfs filesystems
mounted in the directory tree.
compsize /mnt/btrfs-partition
Example output:
Processed 123574 files, 1399139 regular extents (1399139 refs), 69614 inline.
Type Perc Disk Usage Uncompressed Referenced
TOTAL 73% 211G 289G 289G
none 100% 174G 174G 174G
lzo 32% 37G 115G 115G
It requires root (sudo) to work at all
(otherwise SEARCH_V2: Operation not permitted).
It can be used on any directory (totalling the subtree),
not just the whole filesystem from the mountpoint.
On a system with zstd, but some old files still compressed with lzo,
there will be rows for each of them.
(The Perc column is the disk_size / uncompressed_size for that row,
not how much of the total is compressed that way. Smaller is better.)