git-hulk commented on code in PR #3007:
URL: https://github.com/apache/kvrocks/pull/3007#discussion_r2125789948
##########
src/commands/cmd_server.cc:
##########
@@ -309,6 +309,54 @@ class CommandDBSize : public Commander {
}
};
+class CommandKProfile : public Commander {
+ public:
+ Status Parse(const std::vector<std::string> &args) override {
+ CommandParser parser(args, 1);
+ if (!parser.EatEqICase("memory")) {
+ return {Status::NotOK, "only supports MEMORY subcommand"};
+ }
+ if (parser.EatEqICase("enable")) {
+ enabled_ = true;
+ } else if (parser.EatEqICase("disable")) {
+ enabled_ = false;
+ } else if (parser.EatEqICase("dump")) {
+ if (!parser.Good()) return {Status::NotOK, errWrongNumOfArguments};
+ dump_dir_ = GET_OR_RET(parser.TakeStr());
+ } else {
+ return {Status::NotOK, "MEMORY subcommand must be one of ENABLE,
DISABLE, DUMP"};
+ }
Review Comment:
The allocator name is now showing at the `info memory` section, and using
the profiling command on an unsupported allocator will return an error for now.
So I think it should be good to just return `enabled` or `disabled`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]