From: Sage Weil Date: Fri, 28 Apr 2017 13:35:11 +0000 (-0400) Subject: mon/PGMap: include pgs inactive % in summary X-Git-Tag: v12.0.3~124^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14810%2Fhead;p=ceph.git mon/PGMap: include pgs inactive % in summary Signed-off-by: Sage Weil --- diff --git a/src/mon/PGMap.cc b/src/mon/PGMap.cc index 015a6ae4c02..a135e4a9dd1 100644 --- a/src/mon/PGMap.cc +++ b/src/mon/PGMap.cc @@ -1659,6 +1659,18 @@ void PGMap::print_summary(Formatter *f, ostream *out) const << kb_t(osd_sum.kb) << " avail\n"; } + + if (num_pg_active < num_pg) { + float p = (float)num_pg_active / (float)num_pg; + if (f) { + f->dump_float("active_pgs_ratio", p); + } else { + char b[20]; + snprintf(b, sizeof(b), "%.3lf", (1.0 - p) * 100.0); + *out << " " << b << "% pgs inactive\n"; + } + } + list sl; overall_recovery_summary(f, &sl); if (!f && !sl.empty()) {