API to get revision size on disk
From: Julian Foad <julianfoad_at_apache.org>
Date: Tue, 09 Apr 2019 07:23:15 -0400
I am working on an API to report the size on disk of a given revision, in FSFS. A client wants this for (human) informational purposes -- so users or administrators can understand how much space their commits are using.
Before FSFS f7, this information was easy to obtain from the on-disk size of a revision file, or for a packed shard by taking (offset[REV] - offset[REV-1]) from the manifest file. Since f7 it's harder, when revisions are packed.
This seems a reasonable feature to me.
The attached patch starts to implement it, providing an API in this form which is like a cut-down version of svn_fs_fs__get_stats():
/* Set *REV_SIZE to the total size of objects belonging to revision REVISION
and a CLI in this form:
$ svnfsfs rev-size /path/to/repo -r1
The definition of "size" I have chosen excludes the index entries, because determining the on-disk size of them is tricky (they are stored in a variable-length encoding) and their size is not particularly important for the purposes.
TODO before commit:
This is an archived mail posted to the Subversion Dev mailing list.