From: Jianpeng Ma Date: Fri, 2 Dec 2016 18:20:20 +0000 (-0500) Subject: osd: dump kv stats for ObjectStores (if any) X-Git-Tag: v11.1.0~75^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=43c599023f00fb11b5a1a97064f9fbc8721f934b;p=ceph-ci.git osd: dump kv stats for ObjectStores (if any) Signed-off-by: Sage Weil Signed-off-by: Jianpeng Ma --- diff --git a/src/os/ObjectStore.h b/src/os/ObjectStore.h index 3bbce755560..304e352b3a3 100644 --- a/src/os/ObjectStore.h +++ b/src/os/ObjectStore.h @@ -1496,6 +1496,8 @@ public: return 0; } + virtual void get_db_statistics(Formatter *f) { } + virtual string get_type() = 0; // mgmt diff --git a/src/osd/OSD.cc b/src/osd/OSD.cc index d6db61b13dc..fba2fcec5f7 100644 --- a/src/osd/OSD.cc +++ b/src/osd/OSD.cc @@ -1934,6 +1934,8 @@ bool OSD::asok_command(string command, cmdmap_t& cmdmap, string format, f->dump_bool("success", success); f->dump_int("value", value); f->close_section(); + } else if (command == "dump_objectstore_kv_stats") { + store->get_db_statistics(f); } else { assert(0 == "broken asok registration"); } @@ -2393,6 +2395,9 @@ void OSD::final_init() "get malloc extension heap property"); assert(r == 0); + r = admin_socket->register_command("dump_objectstore_kv_stats", "dump_objectstore_kv_stats", asok_hook, + "print statistics of kvdb which used by bluestore"); + assert(r == 0); test_ops_hook = new TestOpsSocketHook(&(this->service), this->store); // Note: pools are CephString instead of CephPoolname because @@ -2714,6 +2719,7 @@ int OSD::shutdown() cct->get_admin_socket()->unregister_command("get_latest_osdmap"); cct->get_admin_socket()->unregister_command("set_heap_property"); cct->get_admin_socket()->unregister_command("get_heap_property"); + cct->get_admin_socket()->unregister_command("dump_objectstore_kv_stats"); delete asok_hook; asok_hook = NULL;