Skip to content

Commit

Permalink
Merge pull request ceph#32406 from neha-ojha/wip-43364
Browse files Browse the repository at this point in the history
mon/PGMap.h: disable network stats in dump_osd_stats

Reviewed-by: Sage Weil <sage@redhat.com>
  • Loading branch information
tchaikov authored Dec 26, 2019
2 parents 62f4ace + ffb8a2a commit 1e5c03d
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/mgr/ActivePyModules.cc
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ PyObject *ActivePyModules::get_python(const std::string &what)
cluster_state.with_pgmap(
[&f, &tstate](const PGMap &pg_map) {
PyEval_RestoreThread(tstate);
pg_map.dump_osd_stats(&f);
pg_map.dump_osd_stats(&f, false);
});
return f.get();
} else if (what == "osd_pool_stats") {
Expand Down
4 changes: 2 additions & 2 deletions src/mon/PGMap.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1595,15 +1595,15 @@ void PGMap::dump_pool_stats(ceph::Formatter *f) const
f->close_section();
}

void PGMap::dump_osd_stats(ceph::Formatter *f) const
void PGMap::dump_osd_stats(ceph::Formatter *f, bool with_net) const
{
f->open_array_section("osd_stats");
for (auto q = osd_stat.begin();
q != osd_stat.end();
++q) {
f->open_object_section("osd_stat");
f->dump_int("osd", q->first);
q->second.dump(f);
q->second.dump(f, with_net);
f->close_section();
}
f->close_section();
Expand Down
2 changes: 1 addition & 1 deletion src/mon/PGMap.h
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,7 @@ class PGMap : public PGMapDigest {
void dump_basic(ceph::Formatter *f) const;
void dump_pg_stats(ceph::Formatter *f, bool brief) const;
void dump_pool_stats(ceph::Formatter *f) const;
void dump_osd_stats(ceph::Formatter *f) const;
void dump_osd_stats(ceph::Formatter *f, bool with_net = false) const;
void dump_delta(ceph::Formatter *f) const;
void dump_filtered_pg_stats(ceph::Formatter *f, std::set<pg_t>& pgs) const;
void dump_pool_stats_full(const OSDMap &osd_map, std::stringstream *ss,
Expand Down
4 changes: 3 additions & 1 deletion src/osd/osd_types.cc
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ void objectstore_perf_stat_t::generate_test_instances(std::list<objectstore_perf
}

// -- osd_stat_t --
void osd_stat_t::dump(Formatter *f) const
void osd_stat_t::dump(Formatter *f, bool with_net) const
{
f->dump_unsigned("up_from", up_from);
f->dump_unsigned("seq", seq);
Expand Down Expand Up @@ -429,6 +429,7 @@ void osd_stat_t::dump(Formatter *f) const
f->open_array_section("alerts");
::dump(f, os_alerts);
f->close_section();
if (with_net) {
f->open_array_section("network_ping_times");
for (auto &i : hb_pingtime) {
f->open_object_section("entry");
Expand Down Expand Up @@ -484,6 +485,7 @@ void osd_stat_t::dump(Formatter *f) const
f->close_section(); // entry
}
f->close_section(); // network_ping_time
}
}

void osd_stat_t::encode(ceph::buffer::list &bl, uint64_t features) const
Expand Down
2 changes: 1 addition & 1 deletion src/osd/osd_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -2409,7 +2409,7 @@ struct osd_stat_t {
}
}
}
void dump(ceph::Formatter *f) const;
void dump(ceph::Formatter *f, bool with_net = true) const;
void encode(ceph::buffer::list &bl, uint64_t features) const;
void decode(ceph::buffer::list::const_iterator &bl);
static void generate_test_instances(std::list<osd_stat_t*>& o);
Expand Down

0 comments on commit 1e5c03d

Please sign in to comment.