]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os: add dump_perf_counters method to ObjectStore implementations.
authorIgor Fedotov <ifedotov@mirantis.com>
Tue, 31 Jan 2017 14:18:12 +0000 (14:18 +0000)
committerIgor Fedotov <ifedotov@mirantis.com>
Tue, 31 Jan 2017 14:30:15 +0000 (14:30 +0000)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/os/ObjectStore.h
src/os/bluestore/BlueStore.h
src/os/filestore/FileStore.h
src/os/kstore/KStore.h

index 6b12bbcebbeef3e7ff4b7fbec43e857b1d5718a8..08f6075ebd4eee0f094df54b68dd4e2594bc1873 100644 (file)
@@ -1502,6 +1502,7 @@ public:
 
   virtual void get_db_statistics(Formatter *f) { }
   virtual void generate_db_histogram(Formatter *f) { }
+  virtual void dump_perf_counters(Formatter *f) {}
 
   virtual string get_type() = 0;
 
index 8ca4ccf659c722fb2e7bb794012f0fb2ae5b45f3..189e684427078f3d4a96931ce60a2ef9d260f2e7 100644 (file)
@@ -34,6 +34,7 @@
 #include "include/memory.h"
 #include "include/mempool.h"
 #include "common/Finisher.h"
+#include "common/perf_counters.h"
 #include "compressor/Compressor.h"
 #include "os/ObjectStore.h"
 
@@ -1815,6 +1816,11 @@ public:
 
   void get_db_statistics(Formatter *f) override;
   void generate_db_histogram(Formatter *f) override;
+  void dump_perf_counters(Formatter *f) override {
+    f->open_object_section("perf_counters");
+    logger->dump_formatted(f, false);
+    f->close_section();
+  }
 
 public:
   int statfs(struct store_statfs_t *buf) override;
index 24fe14a580bc3957ae75b90ca172ac664457ad22..ac57de7998a51d7104eeb33907a47b8e927aa090 100644 (file)
@@ -33,6 +33,7 @@ using namespace std;
 
 #include "common/Timer.h"
 #include "common/WorkQueue.h"
+#include "common/perf_counters.h"
 
 #include "common/Mutex.h"
 #include "HashIndex.h"
@@ -475,6 +476,11 @@ public:
   bool needs_journal() {
     return false;
   }
+  void dump_perf_counters(Formatter *f) override {
+    f->open_object_section("perf_counters");
+    logger->dump_formatted(f, false);
+    f->close_section();
+  }
 
   int write_version_stamp();
   int version_stamp_is_valid(uint32_t *version);
index 755a5a85a4bd90b004136306bd03ba50aec274df..c4acd16590bdba9fb9a4146a9c5e39df8b36097f 100644 (file)
@@ -435,6 +435,11 @@ public:
   int mkjournal() {
     return 0;
   }
+  void dump_perf_counters(Formatter *f) override {
+    f->open_object_section("perf_counters");
+    logger->dump_formatted(f, false);
+    f->close_section();
+  }
 
   int statfs(struct store_statfs_t *buf) override;