]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: make mon summary more concise in 'ceph -s'
authorSage Weil <sage@redhat.com>
Mon, 5 Aug 2019 14:38:28 +0000 (09:38 -0500)
committerSage Weil <sage@redhat.com>
Tue, 6 Aug 2019 03:02:31 +0000 (22:02 -0500)
Signed-off-by: Sage Weil <sage@redhat.com>
PendingReleaseNotes
src/mon/MonMap.cc
src/mon/MonMap.h
src/mon/Monitor.cc

index 8d8a39cd1a74658d6efa180a8e0fd7d1279d8ee0..093e28825d7e014fdb3a1a91d8ade07d35bb4d83 100644 (file)
   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.
index 849349968a7a6b5bfdd034b4cd759d6d9e8bf3a3..90d1ca54daf435c3f28f9af05bf05c0573c11407 100644 (file)
@@ -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).
index ab7fd12ab7b60dfe7193d0587e41c20bf03fe5e0..0432b4e83d5ac38161f4383beab4c2cf9dfb1ca0 100644 (file)
@@ -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<MonMap*>& o);
 protected:
index 6bf7d081724467c4715ad59c7903156c13c9ebd5..713dbe04075210e5af084f399c3665691b2a7526 100644 (file)
@@ -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, ' '));