$ ceph balancer eval-verbose hahapool
...
count_by_pool {'hahapool': {'objects': {0: 1L, 1: 1L, 2: 0L, 3: 0L, 4: 1L}, 'bytes': {0: 0L, 1: 0L, 2: 0L, 3: 0L, 4: 0L}, 'pgs': {0: 35, 1: 42, 2: 23, 3: 30, 4: 26}}}
...
stats_by_root {'default': {'objects': {'min': 0.0, 'max': 1.0, 'score': 0.
2970089549436925, 'stddev': 0.
5477225575051662, 'avg': 0.6, 'sum_weight': 0.
6000000000000001}, 'bytes': {'min': 0, 'max': 0, 'score': 0, 'stddev': 0, 'avg': 0, 'sum_weight': 0}, 'pgs': {'min': 23.0, 'max': 42.0, 'score': 0.
07354228523075643, 'stddev': 7.
52994023880668, 'avg': 31.2, 'sum_weight': 0.4}}}
max/min can give us an intuitive feel of the pg/bytes/object's distribution.
In addition, sometimes we really want to know which osd hold the most
number of pgs/bytes/objects for specified pool.
Signed-off-by: Yang Honggang <yanghonggang@umcloud.com>
for t in ('pgs', 'objects', 'bytes'):
if total[t] == 0:
r[t] = {
+ 'max': 0,
+ 'min': 0,
'avg': 0,
'stddev': 0,
'sum_weight': 0,
stddev = math.sqrt(dev / float(max(num - 1, 1)))
score = score / max(sum_weight, 1)
r[t] = {
+ 'max': max(count[t].values()),
+ 'min': min(count[t].values()),
'avg': avg,
'stddev': stddev,
'sum_weight': sum_weight,