]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
NVMEDevice: add flush perf counter calculate
authorHaomai Wang <haomai@xsky.com>
Sun, 17 Jan 2016 17:18:07 +0000 (01:18 +0800)
committerHaomai Wang <haomai@xsky.com>
Mon, 1 Feb 2016 14:01:27 +0000 (22:01 +0800)
Signed-off-by: Haomai Wang <haomai@xsky.com>
src/kv/RocksDBStore.cc
src/os/bluestore/NVMEDevice.cc

index 672feada22a16f743a44cb4f5e01b8c6d8621c7c..c20b8d52c2cffdb10735180af61eec0e54745aca 100644 (file)
@@ -220,7 +220,7 @@ int RocksDBStore::do_open(ostream &out, bool create_if_missing)
 
   auto cache = rocksdb::NewLRUCache(g_conf->rocksdb_cache_size);
   rocksdb::BlockBasedTableOptions bbt_opts;
-  bbt_opts.block_size = 32 * 1024;
+  bbt_opts.block_size = g_conf->rocksdb_block_size;
   bbt_opts.block_cache = cache;
   opt.table_factory.reset(rocksdb::NewBlockBasedTableFactory(bbt_opts));
   dout(10) << __func__ << " set block size to " << g_conf->rocksdb_block_size
index 53501fb4fdd7179b655af6894ade3214240dc8ff..b530ee180f1e8f51c5bb37ebb304743ee5535e7a 100644 (file)
@@ -498,6 +498,7 @@ void NVMEDevice::_aio_thread()
 int NVMEDevice::flush()
 {
   dout(10) << __func__ << " start" << dendl;
+  utime_t start = ceph_clock_now(g_ceph_context);
   if (inflight_ops.read()) {
     // TODO: this may contains read op
     dout(1) << __func__ << " existed inflight ops " << inflight_ops.read() << dendl;
@@ -508,6 +509,9 @@ int NVMEDevice::flush()
     }
     flush_waiters.dec();
   }
+  utime_t lat = ceph_clock_now(g_ceph_context);
+  lat -= start;
+  logger->tinc(l_bluestore_nvmedevice_flush_lat, lat);
   return 0;
   // nvme device will cause terriable performance degraded
   // while issuing flush command