]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: add bluefs perf counters to track DB/WAL/Slow volume
authorIgor Fedotov <ifedotov@suse.com>
Thu, 19 Jul 2018 12:24:38 +0000 (15:24 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 24 Oct 2018 09:20:20 +0000 (12:20 +0300)
maximums.

Signed-off-by: Igor Fedotov <ifedotov@suse.com>
src/os/bluestore/BlueFS.cc
src/os/bluestore/BlueFS.h

index 7c9160fcc197e601c60e485ad6a05fd8a2ab03a6..01a48ec14a78da7cf816c93339b6674b63f9411a 100644 (file)
@@ -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) {
index 3f555c2a4980d53d2af51037e317d639537bd27e..84ee9631c1c453119cc5be09b70956b2470d70ed 100644 (file)
@@ -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<string, DirRef> dir_map;              ///< dirname -> Dir
   mempool::bluefs::unordered_map<uint64_t,FileRef> file_map; ///< ino -> File