From: Sage Weil Date: Tue, 5 Feb 2019 16:16:44 +0000 (-0600) Subject: mon: include progress events in 'ceph status' output X-Git-Tag: v14.1.0~160^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=a2a39b0cab6b9ce59908bf2de998cee0f693f752;p=ceph-ci.git mon: include progress events in 'ceph status' output Signed-off-by: Sage Weil --- diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index bbc13f9dc4a..1f80a53d411 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -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 "; } }