From: Joao Eduardo Luis Date: Thu, 22 Aug 2013 15:17:12 +0000 (+0100) Subject: test: ceph_test_store_tool: output estimated store size on 'get-size' X-Git-Tag: v0.69~48^2~3 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=41149c44095aa6167b1adc7c8bd9c5431cab55b8;p=ceph.git test: ceph_test_store_tool: output estimated store size on 'get-size' Signed-off-by: Joao Eduardo Luis --- diff --git a/src/test/ObjectMap/test_store_tool/test_store_tool.cc b/src/test/ObjectMap/test_store_tool/test_store_tool.cc index ace91220df6..f81598ccfb8 100644 --- a/src/test/ObjectMap/test_store_tool/test_store_tool.cc +++ b/src/test/ObjectMap/test_store_tool/test_store_tool.cc @@ -90,6 +90,17 @@ class StoreTool exists = false; return bufferlist(); } + + uint64_t get_size() { + map extras; + uint64_t s = db->get_estimated_size(extras); + for (map::iterator p = extras.begin(); + p != extras.end(); ++p) { + std::cout << p->first << " - " << p->second << std::endl; + } + std::cout << "total: " << s << std::endl; + return s; + } }; void usage(const char *pname) @@ -101,6 +112,7 @@ void usage(const char *pname) << " exists [key]\n" << " get \n" << " verify \n" + << " get-size\n" << std::endl; } @@ -173,6 +185,8 @@ int main(int argc, const char *argv[]) } else if (cmd == "verify") { assert(0); + } else if (cmd == "get-size") { + std::cout << "estimated store size: " << st.get_size() << std::endl; } else { std::cerr << "Unrecognized command: " << cmd << std::endl; return 1;