]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: include progress events in 'ceph status' output
authorSage Weil <sage@redhat.com>
Tue, 5 Feb 2019 16:16:44 +0000 (10:16 -0600)
committerSage Weil <sage@redhat.com>
Fri, 8 Feb 2019 19:50:27 +0000 (13:50 -0600)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index bbc13f9dc4a578868e9f03519efa6d88b79035a6..1f80a53d411f5d0c7a0a27c704b7a387cff5b183 100644 (file)
@@ -2897,6 +2897,13 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f)
     f->close_section();
 
     f->dump_object("servicemap", mgrstatmon()->get_service_map());
+
+    f->open_object_section("progress_events");
+    for (auto& i : mgrstatmon()->get_progress_events()) {
+      f->dump_object(i.first.c_str(), i.second);
+    }
+    f->close_section();
+
     f->close_section();
   } else {
     ss << "  cluster:\n";
@@ -2949,6 +2956,23 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f)
 
     ss << "\n \n  data:\n";
     mgrstatmon()->print_summary(NULL, &ss);
+
+    auto& pem = mgrstatmon()->get_progress_events();
+    if (!pem.empty()) {
+      ss << "\n \n  progress:\n";
+      for (auto& i : pem) {
+       ss << "    " << i.second.message << "\n";
+       ss << "      [";
+       unsigned j;
+       for (j=0; j < i.second.progress * 30; ++j) {
+         ss << '=';
+       }
+       for (; j < 30; ++j) {
+         ss << '.';
+       }
+       ss << "]\n";
+      }
+    }
     ss << "\n ";
   }
 }