mirror of
https://github.com/tahoe-lafs/tahoe-lafs.git
synced 2025-03-23 04:05:15 +00:00
cli: tahoe stats: abbreviate total sizes too
This commit is contained in:
parent
9871f3f1b7
commit
677928a1da
@ -47,14 +47,19 @@ class StatsGrabber(SlowOperationRunner):
|
||||
"size-literal-files",
|
||||
"size-directories",
|
||||
"largest-directory",
|
||||
"largest-immutable-files",
|
||||
"largest-immutable-file",
|
||||
)
|
||||
width = max([len(k) for k in keys])
|
||||
print >>stdout, "Counts and Total Sizes:"
|
||||
for k in keys:
|
||||
fmt = "%" + str(width) + "s: %d"
|
||||
if k in data:
|
||||
print >>stdout, fmt % (k, data[k])
|
||||
value = data[k]
|
||||
if not k.startswith("count-") and value > 1000:
|
||||
absize = abbreviate_space_both(value)
|
||||
print >>stdout, fmt % (k, data[k]), " ", absize
|
||||
else:
|
||||
print >>stdout, fmt % (k, data[k])
|
||||
print >>stdout, "Size Histogram:"
|
||||
prevmax = None
|
||||
maxlen = max([len(str(maxsize))
|
||||
|
Loading…
x
Reference in New Issue
Block a user