]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: introduce new BlueFS perf counter to track the amount of
authorIgor Fedotov <ifedotov@suse.com>
Fri, 18 May 2018 14:50:40 +0000 (17:50 +0300)
committerIgor Fedotov <ifedotov@suse.com>
Wed, 27 Jun 2018 11:33:32 +0000 (14:33 +0300)
data written to slow device.

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

index 13af495349591dfccee93dd7badf75d5841dee0a..29e6217a5cc8eaf8569bfac44269fb06cf791beb 100644 (file)
@@ -115,6 +115,9 @@ void BlueFS::_init_logger()
   b.add_u64_counter(l_bluefs_bytes_written_sst, "bytes_written_sst",
                    "Bytes written to SSTs", "sst",
                    PerfCountersBuilder::PRIO_CRITICAL, unit_t(UNIT_BYTES));
+  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));
   logger = b.create_perf_counters();
   cct->get_perfcounters_collection()->add(logger);
 }
@@ -1763,6 +1766,7 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
   h->tail_block.clear();
 
   uint64_t bloff = 0;
+  uint64_t bytes_written_slow = 0;
   while (length > 0) {
     uint64_t x_len = std::min(p->length - x_off, length);
     bufferlist t;
@@ -1798,11 +1802,16 @@ int BlueFS::_flush_range(FileWriter *h, uint64_t offset, uint64_t length)
       bdev[p->bdev]->aio_write(p->offset + x_off, t, h->iocv[p->bdev], buffered);
     }
     h->dirty_devs[p->bdev] = true;
+    if (p->bdev == BDEV_SLOW) {
+      bytes_written_slow += t.length();
+    }
+
     bloff += x_len;
     length -= x_len;
     ++p;
     x_off = 0;
   }
+  logger->inc(l_bluefs_bytes_written_slow, bytes_written_slow);
   for (unsigned i = 0; i < MAX_BDEV; ++i) {
     if (bdev[i]) {
       assert(h->iocv[i]);
index 8e7113519b8cc5e4be2824f893e71eb0583ca708..71c294a0b971961e87e489f15d541e47ceecebc1 100644 (file)
@@ -35,6 +35,7 @@ enum {
   l_bluefs_files_written_sst,
   l_bluefs_bytes_written_wal,
   l_bluefs_bytes_written_sst,
+  l_bluefs_bytes_written_slow,
   l_bluefs_last,
 };