]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/commitdiff
cli: tahoe stats: abbreviate total sizes too
authorBrian Warner <warner@allmydata.com>
Wed, 19 Nov 2008 03:28:16 +0000 (20:28 -0700)
committerBrian Warner <warner@allmydata.com>
Wed, 19 Nov 2008 03:28:16 +0000 (20:28 -0700)
src/allmydata/scripts/tahoe_manifest.py

index 7469f9e9aa4505e0619a215586546df6ceb52cf4..a2facc16051feece3e9ed05d77190daf08944d48 100644 (file)
@@ -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))