From: Igor Fedotov Date: Thu, 19 Jul 2018 12:24:38 +0000 (+0300) Subject: os/bluestore: add bluefs perf counters to track DB/WAL/Slow volume X-Git-Tag: v14.1.0~813^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d55bb12d7b9740301950f177d3a9581f5cabdb70;p=ceph.git os/bluestore: add bluefs perf counters to track DB/WAL/Slow volume maximums. Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/BlueFS.cc b/src/os/bluestore/BlueFS.cc index 7c9160fcc197..01a48ec14a78 100644 --- a/src/os/bluestore/BlueFS.cc +++ b/src/os/bluestore/BlueFS.cc @@ -118,6 +118,12 @@ void BlueFS::_init_logger() b.add_u64_counter(l_bluefs_bytes_written_slow, "bytes_written_slow", "Bytes written to WAL/SSTs at slow device", NULL, PerfCountersBuilder::PRIO_USEFUL, unit_t(UNIT_BYTES)); + b.add_u64_counter(l_bluefs_max_bytes_wal, "max_bytes_wal", + "Maximum bytes allocated from WAL"); + b.add_u64_counter(l_bluefs_max_bytes_db, "max_bytes_db", + "Maximum bytes allocated from DB"); + b.add_u64_counter(l_bluefs_max_bytes_slow, "max_bytes_slow", + "Maximum bytes allocated from SLOW"); logger = b.create_perf_counters(); cct->get_perfcounters_collection()->add(logger); } @@ -2424,6 +2430,13 @@ int BlueFS::_allocate(uint8_t id, uint64_t len, if (alloc[id]) alloc[id]->dump(); return -ENOSPC; + } else { + uint64_t total_allocated = + block_all[id].size() - alloc[id]->get_free(); + if (max_bytes[id] < total_allocated) { + logger->set(max_bytes_pcounters[id], total_allocated); + max_bytes[id] = total_allocated; + } } for (auto& p : extents) { diff --git a/src/os/bluestore/BlueFS.h b/src/os/bluestore/BlueFS.h index 3f555c2a4980..84ee9631c1c4 100644 --- a/src/os/bluestore/BlueFS.h +++ b/src/os/bluestore/BlueFS.h @@ -36,6 +36,9 @@ enum { l_bluefs_bytes_written_wal, l_bluefs_bytes_written_sst, l_bluefs_bytes_written_slow, + l_bluefs_max_bytes_wal, + l_bluefs_max_bytes_db, + l_bluefs_max_bytes_slow, l_bluefs_last, }; @@ -225,6 +228,13 @@ private: PerfCounters *logger = nullptr; + uint64_t max_bytes[MAX_BDEV] = {0}; + uint64_t max_bytes_pcounters[MAX_BDEV] = { + l_bluefs_max_bytes_wal, + l_bluefs_max_bytes_db, + l_bluefs_max_bytes_slow, + }; + // cache mempool::bluefs::map dir_map; ///< dirname -> Dir mempool::bluefs::unordered_map file_map; ///< ino -> File