From a2a39b0cab6b9ce59908bf2de998cee0f693f752 Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Tue, 5 Feb 2019 10:16:44 -0600 Subject: [PATCH] mon: include progress events in 'ceph status' output Signed-off-by: Sage Weil --- src/mon/Monitor.cc | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index bbc13f9dc4a5..1f80a53d411f 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 "; } } -- 2.47.3