mon: move dump_info() to PGStatService

Signed-off-by: Kefu Chai <kchai@redhat.com>
This commit is contained in:
Kefu Chai 2017-05-18 19:58:50 +08:00 committed by Sage Weil
parent 063ad5aa2d
commit 3109da269f
5 changed files with 11 additions and 13 deletions

View 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)

View 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());

View 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 {

View 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;

View 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;