1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-03-09 13:53:09 +00:00

chunks index: show hashtable stats at debug log level, fixes #506

This commit is contained in:
Thomas Waldmann 2024-10-31 20:06:47 +01:00
parent 1f00d29d19
commit 1ec66edeff
No known key found for this signature in database
GPG key ID: 243ACFA951F78E01
2 changed files with 6 additions and 0 deletions

View file

@ -867,6 +867,8 @@ class AdHocWithFilesCache(FilesCacheMixin, ChunksMixin):
integrity_data = self._write_files_cache(self._files)
self.cache_config.integrity[self.files_cache_name()] = integrity_data
if self._chunks is not None:
for key, value in sorted(self._chunks.stats.items()):
logger.debug(f"Chunks index stats: {key}: {value}")
pi.output("Saving chunks cache")
self._write_chunks_cache(self._chunks) # cache/chunks in repo has a different integrity mechanism
pi.output("Saving cache config")

View file

@ -69,6 +69,10 @@ class ChunkIndex(HTProxyMixin, MutableMapping):
def size(self):
return self.ht.size()
@property
def stats(self):
return self.ht.stats
FuseVersionsIndexEntry = namedtuple('FuseVersionsIndexEntry', 'version hash')