Skip to content

Commit c695339

Browse files
authored
count only currently cached datasets in cache size (distributed-system-analysis#3617)
We were counting aggregate cache size for all datasets but reporting that value as if it were "currently cached"; count only currently cached datasets.
1 parent 37be815 commit c695339

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

lib/pbench/cli/server/report.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,8 @@ def report_cache(tree: CacheManager):
215215
cache = Path(tree.cache_root / rid)
216216
if (cache / tarname).exists():
217217
cached_count += 1
218+
if isinstance(size, int):
219+
cached_size += size
218220
try:
219221
referenced = (cache / "last_ref").stat().st_mtime
220222
except Exception as e:
@@ -233,7 +235,6 @@ def report_cache(tree: CacheManager):
233235
bad_size += 1
234236
else:
235237
sizecomp.add(dsname, size)
236-
cached_size += size
237238

238239
# Check compression ratios
239240
if tarball:

0 commit comments

Comments
 (0)