Skip to content

Commit 51f7023

Browse files
committed
only use 1 star per block if it can print within 80 char
1 parent 1b230f8 commit 51f7023

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

bin/btrfs-blockgroup-report

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,9 @@ def report_usage(args):
117117
stats = chunk_stats[data_flag]
118118

119119
print('\t', data_flag)
120-
print('\t' * 2, 'Blockgroups at least partially on disk:', stats['count'])
121120
print('\t' * 2, 'Data-device dependance:', pretty_size(stats['size_used']))
122-
print('\t' * 2, 'Approx. blockgroup percentage packed:')
121+
print('\t' * 2, 'Blockgroups at least partially on disk:', stats['count'])
122+
print('\t' * 2, 'Blockgroup packing:')
123123

124124
grouped_stats = {}
125125
for percent in stats['percent_used']:
@@ -131,7 +131,7 @@ def report_usage(args):
131131

132132
max_count = max(count for _group, count in grouped_stats.items())
133133
for group, count in sorted(grouped_stats.items()):
134-
scaled_count = int(60 * count / max_count)
134+
scaled_count = int(60 * count / max_count) if max_count > 60 else count
135135
print(
136136
'\t' * 2,
137137
f' {str(group).rjust(3)}% packed',

0 commit comments

Comments
 (0)