]> git.proxmox.com Git - ceph.git/blobdiff - ceph/src/test/fio/fio_ceph_objectstore.cc
update sources to v12.1.0
[ceph.git] / ceph / src / test / fio / fio_ceph_objectstore.cc
index 2123671a7fbde7e622c105a2712688c6bc85de94..604c44c59f1d2fd17016d51b72067b54eaf01b4e 100644 (file)
@@ -87,10 +87,16 @@ struct Engine {
       ostringstream ostr;
       Formatter* f = Formatter::create("json-pretty", "json-pretty", "json-pretty");
       os->dump_perf_counters(f);
+      ostr << "FIO plugin ";
       f->flush(ostr);
+      if (g_conf->rocksdb_perf) {
+        os->get_db_statistics(f);
+        ostr << "FIO get_db_statistics ";
+        f->flush(ostr);
+      }
       delete f;
       os->umount();
-      dout(0) << "FIO plugin " << ostr.str() << dendl;
+      dout(0) <<  ostr.str() << dendl;
     }
   }
 };
@@ -124,7 +130,14 @@ Engine::Engine(const thread_data* td) : ref_count(0)
   if (!os)
     throw std::runtime_error("bad objectstore type " + g_conf->osd_objectstore);
 
-  os->set_cache_shards(g_conf->osd_op_num_shards);
+  unsigned num_shards;
+  if(g_conf->osd_op_num_shards)
+    num_shards = g_conf->osd_op_num_shards;
+  else if(os->is_rotational())
+    num_shards = g_conf->osd_op_num_shards_hdd;
+  else
+    num_shards = g_conf->osd_op_num_shards_ssd;
+  os->set_cache_shards(num_shards);
 
   int r = os->mkfs();
   if (r < 0)
@@ -150,7 +163,9 @@ struct Collection {
   static constexpr int64_t MIN_POOL_ID = 0x0000ffffffffffff;
 
   Collection(const spg_t& pg)
-    : pg(pg), cid(pg), sequencer(stringify(pg)) {}
+    : pg(pg), cid(pg), sequencer(stringify(pg)) {
+    sequencer.shard_hint = pg;
+  }
 };
 
 struct Object {