]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
OSDMap: add osdmap epoch info when printing info summary
authorshun-s <song.shun3@zte.com.cn>
Tue, 30 Jan 2018 13:32:59 +0000 (21:32 +0800)
committershun-s <song.shun3@zte.com.cn>
Fri, 2 Feb 2018 04:45:23 +0000 (12:45 +0800)
  add osdmap epoch info when printing info summary

Signed-off-by: shun-s <song.shun3@zte.com.cn>
src/mon/OSDMonitor.cc
src/osd/OSDMap.cc
src/osd/OSDMap.h

index 87ab8c03afea9d1da9db3b01fec639b744f8ff9b..3ddcfd3b254591fa300aa2c78d6654de54d7d089 100644 (file)
@@ -3621,7 +3621,7 @@ bool OSDMonitor::preprocess_command(MonOpRequestRef op)
   boost::scoped_ptr<Formatter> f(Formatter::create(format));
 
   if (prefix == "osd stat") {
-    osdmap.print_summary(f.get(), ds, "");
+    osdmap.print_summary(f.get(), ds, "", true);
     if (f)
       f->flush(rdata);
     else
index 0d4059d4639b8084f36089e05ebae9831696e7b0..a70f80dc774a33a49b6d3d91ca7af39df408afd6 100644 (file)
@@ -3373,7 +3373,7 @@ void OSDMap::print_tree(Formatter *f, ostream *out, unsigned filter, string buck
 }
 
 void OSDMap::print_summary(Formatter *f, ostream& out,
-                          const string& prefix) const
+                          const string& prefix, bool extra) const
 {
   if (f) {
     f->open_object_section("osdmap");
@@ -3389,6 +3389,8 @@ void OSDMap::print_summary(Formatter *f, ostream& out,
     out << get_num_osds() << " osds: "
        << get_num_up_osds() << " up, "
        << get_num_in_osds() << " in";
+    if (extra)
+      out << "; epoch: e" << get_epoch();
     if (get_num_pg_temp())
       out << "; " << get_num_pg_temp() << " remapped pgs";
     out << "\n";
index bc1e581d873459d211206a0280396a2581eff367..cf208c0f22a61aacc8a6b549ad2b5feee9193adf 100644 (file)
@@ -1373,7 +1373,7 @@ private:
 public:
   void print(ostream& out) const;
   void print_pools(ostream& out) const;
-  void print_summary(Formatter *f, ostream& out, const string& prefix) const;
+  void print_summary(Formatter *f, ostream& out, const string& prefix, bool extra=false) const;
   void print_oneline_summary(ostream& out) const;
 
   enum {