-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add infoCmd section:server stats cpu commandstats #326
feat: add infoCmd section:server stats cpu commandstats #326
Conversation
632751a
to
106f06e
Compare
} | ||
std::atomic<uint64_t> cmd_count = 0; | ||
std::atomic<uint64_t> cmd_time_consuming = 0; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cmd_count_
cmd_time_consuming_
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
@@ -215,6 +239,10 @@ class PClient : public std::enable_shared_from_this<PClient>, public CmdRes { | |||
// e.g:["set","key","value"] | |||
std::span<std::string> argv_; | |||
|
|||
// Info Commandstats used | |||
std::shared_ptr<TimeStat> time_stat_; | |||
std::unordered_map<std::string, CommandStatistics>* GetCommandStatMap(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
对TimeStat的相关操作封装一下,time_stat_设置成私有的
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
const std::string InfoCmd::kDataSection = "data"; | ||
const std::string InfoCmd::kCommandStatsSection = "commandstats"; | ||
const std::string InfoCmd::kRaftSection = "RAFT"; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里有的大写有的小写 统一成大写吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这里有的大写有的小写 统一成大写吧
redis 官方info cmd的section是小写,我觉得得小写,info RAFT section只是暂用,不知道braft哪里会用到,所以我觉得要么就都先暂留着?(// @todo The info raft command is only supported for the time being)
这个方便增加 go_test 么 |
Is this convenient to add go_test? |
106f06e
to
12fe044
Compare
我觉得不是很好添加,因为info只是用于显示命令输出 |
I don't think it's very good to add, because info is only used to display command output |
I have been very busy in the past three weeks. This PR has been modified according to the comments, but it cannot be compiled locally. I will take a closer look when I am finished. |
@CodiumAI-Agent /improve |
PR Code Suggestions ✨
|
@CodiumAI-Agent /review |
PR Review 🔍
Code feedback:
|
添加infoCmd的部分选项