Merge pull request #30432 from yanghonggang/wip-yhg-balancer-eval-maxmin

pybind/mgr/balancer/module.py: add max/min info in stats_by_root

Reviewed-by: xie xingguo <xie.xingguo@zte.com.cn>
This commit is contained in:
Kefu Chai 2019-09-22 12:12:21 +08:00 committed by GitHub
commit d90b4701c4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -141,6 +141,8 @@ class Eval:
for t in ('pgs', 'objects', 'bytes'):
if total[t] == 0:
r[t] = {
'max': 0,
'min': 0,
'avg': 0,
'stddev': 0,
'sum_weight': 0,
@ -189,6 +191,8 @@ class Eval:
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,