mirror of
https://github.com/ceph/ceph
synced 2025-01-02 17:12:31 +00:00
Merge pull request #13531 from LiumxNL/fix-osd-utilization
mon/OSDMonitor: fix dividing by zero in OSDUtilizationDumper Reviewed-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
commit
af5e1e8d39
@ -679,7 +679,9 @@ protected:
|
||||
int64_t kb = 0, kb_used = 0, kb_avail = 0;
|
||||
double util = 0;
|
||||
if (get_bucket_utilization(qi.id, &kb, &kb_used, &kb_avail))
|
||||
util = 100.0 * (double)kb_used / (double)kb;
|
||||
if (kb_used && kb)
|
||||
util = 100.0 * (double)kb_used / (double)kb;
|
||||
|
||||
double var = 1.0;
|
||||
if (average_util)
|
||||
var = util / average_util;
|
||||
|
Loading…
Reference in New Issue
Block a user