For large cluster with thousands of osds/pgs, it may take
seconds even mitutes to refresh the relevant stats.
Since we already have pulling them down at initialization,
make a direct use of them whenever possible.
Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
inc = plan.inc
total_did = 0
left = max_optimizations
- osdmap_dump = self.get_osdmap().dump()
+ osdmap_dump = ms.osdmap_dump
pools_with_pg_merge = [p['pool_name'] for p in osdmap_dump.get('pools', [])
if p['pg_num'] > p['pg_num_target']]
crush_rule_by_pool_name = dict((p['pool_name'], p['crush_rule']) for p in osdmap_dump.get('pools', []))
# since scrubbing activities have significant impacts on performance
pool_ids = list(p['pool'] for p in pool_dump if p['pool_name'] in it)
num_pg_active_clean = 0
- pg_dump = self.get('pg_dump')
+ pg_dump = ms.pg_dump
for p in pg_dump['pg_stats']:
pg_pool = p['pgid'].split('.')[0]
if len(pool_ids) and int(pg_pool) not in pool_ids: