diff options
author | Sage Weil <sage@redhat.com> | 2017-05-30 20:47:04 +0200 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2017-05-31 20:48:00 +0200 |
commit | 5f37da539ac0da3eb35c80c81d053075a3fdc381 (patch) | |
tree | dd670d520fc7859c598e7d9e9343b87bae456eb0 /src/common/mempool.cc | |
parent | osd: (loosely) mark cached map bl buffers as osd_mapbl (diff) | |
download | ceph-5f37da539ac0da3eb35c80c81d053075a3fdc381.tar.xz ceph-5f37da539ac0da3eb35c80c81d053075a3fdc381.zip |
mempool: dump total, too
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/common/mempool.cc')
-rw-r--r-- | src/common/mempool.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/common/mempool.cc b/src/common/mempool.cc index ccb74dd1ea0..b6666d6b41b 100644 --- a/src/common/mempool.cc +++ b/src/common/mempool.cc @@ -41,12 +41,14 @@ const char *mempool::get_pool_name(mempool::pool_index_t ix) { void mempool::dump(ceph::Formatter *f) { + stats_t total; for (size_t i = 0; i < num_pools; ++i) { const pool_t &pool = mempool::get_pool((pool_index_t)i); f->open_object_section(get_pool_name((pool_index_t)i)); - pool.dump(f); + pool.dump(f, &total); f->close_section(); } + f->dump_object("total", total); } void mempool::set_debug_mode(bool d) @@ -103,11 +105,14 @@ void mempool::pool_t::get_stats( } } -void mempool::pool_t::dump(ceph::Formatter *f) const +void mempool::pool_t::dump(ceph::Formatter *f, stats_t *ptotal) const { stats_t total; std::map<std::string, stats_t> by_type; get_stats(&total, &by_type); + if (ptotal) { + *ptotal += total; + } f->dump_object("total", total); if (!by_type.empty()) { for (auto &i : by_type) { |