swift-manage-shard-ranges: output total compactible sequences

After individual compactible sequences have been listed, add a summary
line such as:

  Total of 123 shard sequences identified for compaction.

Change-Id: I087c2c1885f86ff8163ce358e25dc3c092897223
This commit is contained in:
Alistair Coles 2021-05-13 12:05:20 +01:00
parent 568036f1b7
commit 5d1d48c773
2 changed files with 3 additions and 0 deletions

View File

@ -524,6 +524,8 @@ def compact_shard_ranges(broker, args):
_print_shard_range(donor, level=1)
print('can be compacted into acceptor shard range:')
_print_shard_range(acceptor, level=1)
print('Total of %d shard sequences identified for compaction.'
% len(compactible))
print('Once applied to the broker these changes will result in shard '
'range compaction the next time the sharder runs.')

View File

@ -894,6 +894,7 @@ class TestManageShardRanges(unittest.TestCase):
" '.shards_a",
" objects: 100001, tombstones: 999, lower: 'obj79'",
" state: active, upper: 'obj89'",
'Total of 2 shard sequences identified for compaction.',
'Once applied to the broker these changes will result in '
'shard range compaction the next time the sharder runs.',
]