borg compact iterates over all archives, over all items in each archive. If an item has a chunks list, it processes the (id, size) list entries to determine which chunks are used.
It does not write the (plaintext) size information into the chunks index data structure yet, but only sums it up in total_size (resulting in the overall, not deduplicated file input size).
If we put size into the index also, we could easily compute the overall deduplicated (but uncompressed, unencrypted) size.
repository_size computes the overall deduplicated, compressed, encrypted size.
By comparing these 2, we could see the compression factor (and also the encryption and storage overhead).
By comparing the not deduplicated and the deduplicated value, we could see the deduplication factor.
All this comes at negligible cost and is easy to implement.
borg compact iterates over all archives, over all items in each archive. If an item has a chunks list, it processes the
(id, size)list entries to determine which chunks are used.It does not write the (plaintext) size information into the chunks index data structure yet, but only sums it up in total_size (resulting in the overall, not deduplicated file input size).
If we put size into the index also, we could easily compute the overall deduplicated (but uncompressed, unencrypted) size.
repository_size computes the overall deduplicated, compressed, encrypted size.
By comparing these 2, we could see the compression factor (and also the encryption and storage overhead).
By comparing the not deduplicated and the deduplicated value, we could see the deduplication factor.
All this comes at negligible cost and is easy to implement.