From: Sage Weil Date: Mon, 5 Aug 2019 14:38:28 +0000 (-0500) Subject: mon: make mon summary more concise in 'ceph -s' X-Git-Tag: v15.1.0~1928^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3e7c185bd4b2312f9801b8664fb175801c904871;p=ceph-ci.git mon: make mon summary more concise in 'ceph -s' Signed-off-by: Sage Weil --- diff --git a/PendingReleaseNotes b/PendingReleaseNotes index 8d8a39cd1a7..093e28825d7 100644 --- a/PendingReleaseNotes +++ b/PendingReleaseNotes @@ -101,5 +101,6 @@ on all osds, or provided osds, thus simplifying the process of having to parse `osd dump` for the same information. -* The `mgrmap` metadata included in the structured ``ceph status`` (``ceph -s``) - output is now more concise. \ No newline at end of file +* The structured output of ``ceph status`` or ``ceph -s`` is now more + concise, particularly the `mgrmap` and `monmap` sections, and the + structure of the `osdmap` section has been cleaned up. diff --git a/src/mon/MonMap.cc b/src/mon/MonMap.cc index 849349968a7..90d1ca54daf 100644 --- a/src/mon/MonMap.cc +++ b/src/mon/MonMap.cc @@ -356,6 +356,14 @@ void MonMap::dump(Formatter *f) const f->close_section(); } +void MonMap::dump_summary(Formatter *f) const +{ + f->dump_unsigned("epoch", epoch); + f->dump_string("min_mon_release_name", ceph::to_string(min_mon_release)); + f->dump_unsigned("num_mons", ranks.size()); +} + + // an ambiguous mon addr may be legacy or may be msgr2--we aren' sure. // when that happens we need to try them both (unless we can // reasonably infer from the port number which it is). diff --git a/src/mon/MonMap.h b/src/mon/MonMap.h index ab7fd12ab7b..0432b4e83d5 100644 --- a/src/mon/MonMap.h +++ b/src/mon/MonMap.h @@ -452,6 +452,7 @@ public: void print(std::ostream& out) const; void print_summary(std::ostream& out) const; void dump(ceph::Formatter *f) const; + void dump_summary(ceph::Formatter *f) const; static void generate_test_instances(std::list& o); protected: diff --git a/src/mon/Monitor.cc b/src/mon/Monitor.cc index 6bf7d081724..713dbe04075 100644 --- a/src/mon/Monitor.cc +++ b/src/mon/Monitor.cc @@ -2950,7 +2950,7 @@ void Monitor::get_cluster_status(stringstream &ss, Formatter *f) mono_clock::now() - quorum_since).count()); } f->open_object_section("monmap"); - monmap->dump(f); + monmap->dump_summary(f); f->close_section(); f->open_object_section("osdmap"); osdmon()->osdmap.print_summary(f, cout, string(12, ' '));