mon/PGMonitor: calc the %USED of pool using used/(used+avail)
we were using
"the raw space used by this pool" / "the raw space of the whole cluster"
as the %USED. but it's wrong:
- there is chance that not all OSDs are assigned to the pool in question
- we can not utilize all the raw space for the pool: there is overhead.
and the size of available space for a pool is capped by the assigned
OSD with minimal free space.
so we should use
USED / (USED + AVAIL)
as the %USED. so once we have no AVAIL space left, %USED will be 100%.
Fixes: http://tracker.ceph.com/issues/16933
Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit
08532ea166dfd97c548d9f1fb478e163021cdda3)
Conflicts:
src/test/mon/CMakeLists.txt (file does not exist in hammer)