scripts: maps: Assume percentages never hit 100.0%
This isn't true, especially for dbgbmap.py, 100% is very possible in filesystems with small files. But by limiting padding to 99.9%, we avoid the annoying wasted space caused by the rare but occasional 100.0%.
This commit is contained in:
+1
-1
@@ -4588,7 +4588,7 @@ def main_(ring, disk, mroots=None, *,
|
||||
lfs.cksum,
|
||||
'' if lfs.ckgcksum() else '?'))
|
||||
else:
|
||||
title_ = ('bd %sx%s, %6s mdir, %6s btree, %6s data' % (
|
||||
title_ = ('bd %sx%s, %5s mdir, %5s btree, %5s data' % (
|
||||
lfs.block_size if lfs.block_size is not None else '?',
|
||||
lfs.block_count if lfs.block_count is not None else '?',
|
||||
'%.1f%%' % (100*mdir_count / max(len(bmap), 1)),
|
||||
|
||||
+4
-4
@@ -1246,16 +1246,16 @@ def main(path='-', *,
|
||||
else:
|
||||
title_ = ('bd %dx%d%s%s%s%s' % (
|
||||
block_size_, block_count_,
|
||||
', %6s read' % (
|
||||
', %5s read' % (
|
||||
'%.1f%%' % (100*readed / max(total, 1)))
|
||||
if reads else '',
|
||||
', %6s prog' % (
|
||||
', %5s prog' % (
|
||||
'%.1f%%' % (100*proged / max(total, 1)))
|
||||
if progs else '',
|
||||
', %6s erase' % (
|
||||
', %5s erase' % (
|
||||
'%.1f%%' % (100*erased / max(total, 1)))
|
||||
if erases else '',
|
||||
', %15s wear' % (
|
||||
', %13s wear' % (
|
||||
'%.1f%% +-%.1fσ' % (
|
||||
100*wear_avg / max(block_cycles_, 1),
|
||||
100*wear_stddev / max(block_cycles_, 1)))
|
||||
|
||||
Reference in New Issue
Block a user