From: Brian Warner Date: Wed, 19 Nov 2008 03:28:16 +0000 (-0700) Subject: cli: tahoe stats: abbreviate total sizes too X-Git-Tag: allmydata-tahoe-1.3.0~402 X-Git-Url: https://git.rkrishnan.org/pf/content/en/service/nxhtml.html?a=commitdiff_plain;h=677928a1da95a7189667d309501e178604f147b4;p=tahoe-lafs%2Ftahoe-lafs.git cli: tahoe stats: abbreviate total sizes too --- diff --git a/src/allmydata/scripts/tahoe_manifest.py b/src/allmydata/scripts/tahoe_manifest.py index 7469f9e9..a2facc16 100644 --- a/src/allmydata/scripts/tahoe_manifest.py +++ b/src/allmydata/scripts/tahoe_manifest.py @@ -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))