]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mon/PGMap: include pgs inactive % in summary 14810/head
authorSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 13:35:11 +0000 (09:35 -0400)
committerSage Weil <sage@redhat.com>
Fri, 28 Apr 2017 13:35:11 +0000 (09:35 -0400)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/PGMap.cc

index 015a6ae4c027778286a3807f28747e4c561812f5..a135e4a9dd1abc5da9dadf845aa66f171a0b939b 100644 (file)
@@ -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<string> sl;
   overall_recovery_summary(f, &sl);
   if (!f && !sl.empty()) {