From 5e3b76791e92a75f3cc534728a858d1ca9712a04 Mon Sep 17 00:00:00 2001 From: Simone Scarduzio Date: Thu, 9 Oct 2025 22:20:32 +0200 Subject: [PATCH] fix: Exclude reference.bin from bucket stats calculations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit reference.bin files are internal implementation details used for delta compression. Their size was being incorrectly counted in both total_size and compressed_size, resulting in 0% savings contribution. Since delta file metadata already contains the original file_size that the delta represents, including reference.bin would double-count storage. This fix skips reference.bin files during stats calculation, consistent with how they're filtered in other parts of the codebase (aws_compat.py, sync.py, client.py). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- src/deltaglider/client_operations/stats.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/deltaglider/client_operations/stats.py b/src/deltaglider/client_operations/stats.py index d6b1795..e639203 100644 --- a/src/deltaglider/client_operations/stats.py +++ b/src/deltaglider/client_operations/stats.py @@ -141,6 +141,11 @@ def get_bucket_stats( direct_count = 0 for obj in all_objects: + # Skip reference.bin files - they are internal implementation details + # and their size is already accounted for in delta metadata + if obj.key.endswith("/reference.bin") or obj.key == "reference.bin": + continue + compressed_size += obj.size if obj.is_delta: