Merge pull request #8504 from ThomasWaldmann/debug-show-chunksindex-stats

chunks index: show hashtable stats at debug log level, fixes #506
This commit is contained in:
TW 2024-10-31 20:28:05 +01:00 committed by GitHub
commit 3a66fd78c2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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')