Log repo pack / ref statistics after repack
We have poor visibility into the shape and size of Git repositories we host. I suggest we start logging small reports every time we do a repack (GarbageCollect, RepackFull, RepackIncremental, FetchIntoObjectPool).
Object statistics:
- number of loose objects
- total size of loose objects
- number of packfiles
- total size of packfiles (just the
.pack) - same statistics for alternates (pool), if present
These can all be obtained from a single walk of objects/.
Ref statistics:
- number of loose refs
- number of top-level namespaces (
refs/heads,refs/tags, etc.) - ref count per namespace for top 5 (e.g.
refs/heads100,refs/keeparound80,refs/tags15)
These numbers can be obtained by parsing git for-each-ref and a walk of refs/ (for the loose ref count).