]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
mon: move dump_info() to PGStatService
authorKefu Chai <kchai@redhat.com>
Thu, 18 May 2017 11:58:50 +0000 (19:58 +0800)
committerSage Weil <sage@redhat.com>
Fri, 2 Jun 2017 17:02:43 +0000 (13:02 -0400)
Signed-off-by: Kefu Chai <kchai@redhat.com>
src/mon/MgrStatMonitor.cc
src/mon/Monitor.cc
src/mon/PGMonitor.cc
src/mon/PGMonitor.h
src/mon/PGStatService.h

index 00ac773e620db07981a6096c2a90c30997197ca3..9e9dafc01bf71c5c3956e480d5557b5b378aa1b4 100644 (file)
@@ -45,6 +45,9 @@ public:
   void print_summary(Formatter *f, ostream *out) const override {
     digest.print_summary(f, out);
   }
+  void dump_info(Formatter *f) const override {
+    digest.dump(f);
+  }
   void dump_fs_stats(stringstream *ss,
                     Formatter *f,
                     bool verbose) const override {
@@ -129,6 +132,7 @@ void MgrStatMonitor::tick()
 
 void MgrStatMonitor::print_summary(Formatter *f, std::ostream *ss) const
 {
+  pgservice->print_summary(f, ss);
 }
 
 bool MgrStatMonitor::preprocess_query(MonOpRequestRef op)
index 9d39f3be7921f698c7bfb4fd3a17b9cb701a7b72..5c3b1d8edb7cdf6960fe6d6ef0fbff8843eab402 100644 (file)
@@ -3133,8 +3133,8 @@ void Monitor::handle_command(MonOpRequestRef op)
     monmon()->dump_info(f.get());
     osdmon()->dump_info(f.get());
     mdsmon()->dump_info(f.get());
-    pgmon()->dump_info(f.get());
     authmon()->dump_info(f.get());
+    pgservice->dump_info(f.get());
 
     paxos->dump_info(f.get());
 
index 48a7c0834f602d3cba3275dbcf344123b56c009a..05199dd2a2957c88aad43e349f685e1b7a3bf589 100644 (file)
@@ -929,16 +929,6 @@ epoch_t PGMonitor::send_pg_creates(int osd, Connection *con, epoch_t next)
   return last + 1;
 }
 
-void PGMonitor::dump_info(Formatter *f) const
-{
-  f->open_object_section("pgmap");
-  pg_map.dump(f);
-  f->close_section();
-
-  f->dump_unsigned("pgmap_first_committed", get_first_committed());
-  f->dump_unsigned("pgmap_last_committed", get_last_committed());
-}
-
 bool PGMonitor::preprocess_command(MonOpRequestRef op)
 {
   op->mark_pgmon_event(__func__);
@@ -1280,6 +1270,11 @@ public:
   void print_summary(Formatter *f, ostream *out) const override {
     pgmap.print_summary(f, out);
   }
+  void dump_info(Formatter *f) const override {
+    f->dump_object("pgmap", pgmap);
+    f->dump_unsigned("pgmap_first_committed", pgmon->get_first_committed());
+    f->dump_unsigned("pgmap_last_committed", pgmon->get_last_committed());
+  }
   void dump_fs_stats(stringstream *ss,
                     Formatter *f,
                     bool verbose) const override {
index 347fc8f4a61a19625a4a53c757511051423c3054..6ba82ea12b5857a5430e074bf589c8337ce76460 100644 (file)
@@ -115,8 +115,6 @@ public:
 
   void check_osd_map(epoch_t epoch);
 
-  void dump_info(Formatter *f) const;
-
   int _warn_slow_request_histogram(const pow2_hist_t& h, string suffix,
                                   list<pair<health_status_t,string> >& summary,
                                   list<pair<health_status_t,string> > *detail) const;
index 4064b109ea9c34ebbae00e13461aac1bff9d1604..63ed09844d875b38e36301c3ac4d92ef2284187f 100644 (file)
@@ -84,6 +84,7 @@ public:
 
   virtual size_t get_num_pg_by_osd(int osd) const = 0;
   virtual void print_summary(Formatter *f, ostream *out) const = 0;
+  virtual void dump_info(Formatter *f) const = 0;
   virtual void dump_fs_stats(stringstream *ss, Formatter *f, bool verbose) const = 0;
   virtual void dump_pool_stats(const OSDMap& osdm, stringstream *ss, Formatter *f,
                               bool verbose) const = 0;