]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
kv/rocksdb: return error for dump_objectstore_kv_stats asok command 58728/head
authorIgor Fedotov <igor.fedotov@croit.io>
Mon, 22 Jul 2024 14:15:45 +0000 (17:15 +0300)
committerIgor Fedotov <igor.fedotov@croit.io>
Mon, 22 Jul 2024 15:43:30 +0000 (18:43 +0300)
if relevant config settings result in no output.

Signed-off-by: Igor Fedotov <igor.fedotov@croit.io>
src/kv/RocksDBStore.cc

index a653fa6398c29b182bb1a8d7f034014cc6d43ad9..bef87d15ed73b34731d2378995725dde213c21e2 100644 (file)
@@ -1417,8 +1417,13 @@ int64_t RocksDBStore::estimate_prefix_size(const string& prefix,
 void RocksDBStore::get_statistics(Formatter *f)
 {
   if (!cct->_conf->rocksdb_perf)  {
-    dout(20) << __func__ << " RocksDB perf is disabled, can't probe for stats"
-            << dendl;
+    f->write_raw_data("error: RocksDB perf is disabled, can't probe for stats.\n");
+    return;
+  }
+  if (!cct->_conf->rocksdb_collect_compaction_stats &&
+      !cct->_conf->rocksdb_collect_extended_stats &&
+      !cct->_conf->rocksdb_collect_memory_stats)  {
+    f->write_raw_data("error: None of rocksdb_collect_* setting is enabled, hence no output.\n");
     return;
   }