From: Sage Weil Date: Thu, 31 May 2012 03:15:34 +0000 (-0700) Subject: admin_socket: streamline command set X-Git-Tag: v0.48argonaut~143^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=ca8f3ba8e9e05f8c421d519db81f613691629f86;p=ceph.git admin_socket: streamline command set log flush log dump log reopen config show config set perf dump perf schema Signed-off-by: Sage Weil --- diff --git a/src/common/ceph_context.cc b/src/common/ceph_context.cc index d0ecc3ee54df4..7d2bea9ba445f 100644 --- a/src/common/ceph_context.cc +++ b/src/common/ceph_context.cc @@ -162,22 +162,24 @@ public: void CephContext::do_command(std::string command, bufferlist *out) { lgeneric_dout(this, 1) << "do_command '" << command << "'" << dendl; - if (command == "perfcounters_dump" || command == "1") { + if (command == "perfcounters_dump" || command == "1" || + command == "perf dump") { std::vector v; _perf_counters_collection->write_json_to_buf(v, false); out->append(&v[0], v.size()); } - else if (command == "perfcounters_schema" || command == "2") { + else if (command == "perfcounters_schema" || command == "2" || + command == "perf schema") { std::vector v; _perf_counters_collection->write_json_to_buf(v, true); out->append(&v[0], v.size()); } - else if (command == "show_config") { + else if (command == "config show") { ostringstream ss; _conf->show_config(ss); out->append(ss.str()); } - else if (command.find("set_config ") == 0) { + else if (command.find("config set ") == 0) { std::string var = command.substr(11); size_t pos = var.find(' '); if (pos == string::npos) { @@ -196,13 +198,13 @@ void CephContext::do_command(std::string command, bufferlist *out) out->append(ss.str()); } } - else if (command == "log_flush") { + else if (command == "log flush") { _log->flush(); } - else if (command == "log_dump_recent") { + else if (command == "log dump") { _log->dump_recent(); } - else if (command == "log_reopen") { + else if (command == "log reopen") { _log->reopen_log_file(); } else { @@ -236,15 +238,17 @@ CephContext::CephContext(uint32_t module_type_) _heartbeat_map = new HeartbeatMap(this); _admin_hook = new CephContextHook(this); - _admin_socket->register_command("perfcounters_dump", _admin_hook, "dump perfcounters value"); + _admin_socket->register_command("perfcounters_dump", _admin_hook, ""); _admin_socket->register_command("1", _admin_hook, ""); - _admin_socket->register_command("perfcounters_schema", _admin_hook, "dump perfcounters schema"); + _admin_socket->register_command("perf dump", _admin_hook, "dump perfcounters value"); + _admin_socket->register_command("perfcounters_schema", _admin_hook, ""); _admin_socket->register_command("2", _admin_hook, ""); - _admin_socket->register_command("show_config", _admin_hook, "dump current config settings"); - _admin_socket->register_command("set_config", _admin_hook, "set_config : set a config settings"); - _admin_socket->register_command("log_flush", _admin_hook, "flush log entries to log file"); - _admin_socket->register_command("log_dump_recent", _admin_hook, "dump recent log entries to log file"); - _admin_socket->register_command("log_reopen", _admin_hook, "reopen log file"); + _admin_socket->register_command("perf schema", _admin_hook, "dump perfcounters schema"); + _admin_socket->register_command("config show", _admin_hook, "dump current config settings"); + _admin_socket->register_command("config set", _admin_hook, "set_config : set a config settings"); + _admin_socket->register_command("log flush", _admin_hook, "flush log entries to log file"); + _admin_socket->register_command("log dump", _admin_hook, "dump recent log entries to log file"); + _admin_socket->register_command("log reopen", _admin_hook, "reopen log file"); } CephContext::~CephContext() @@ -252,14 +256,16 @@ CephContext::~CephContext() join_service_thread(); _admin_socket->unregister_command("perfcounters_dump"); + _admin_socket->unregister_command("perf dump"); _admin_socket->unregister_command("1"); _admin_socket->unregister_command("perfcounters_schema"); + _admin_socket->unregister_command("perf schema"); _admin_socket->unregister_command("2"); - _admin_socket->unregister_command("show_config"); - _admin_socket->unregister_command("set_config"); - _admin_socket->unregister_command("log_flush"); - _admin_socket->unregister_command("log_dump_recent"); - _admin_socket->unregister_command("log_reopen"); + _admin_socket->unregister_command("config show"); + _admin_socket->unregister_command("config set"); + _admin_socket->unregister_command("log flush"); + _admin_socket->unregister_command("log dump"); + _admin_socket->unregister_command("log reopen"); delete _admin_hook; delete _heartbeat_map;