-
Notifications
You must be signed in to change notification settings - Fork 1.2k
feat: Add p99 and slow command count #3042
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
Conversation
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
src/pika_client_conn.cc
Outdated
auto end_time = std::chrono::high_resolution_clock::now(); | ||
|
||
time_stat_->process_done_ts_ = pstd::NowMicros(); | ||
std::chrono::duration<double, std::milli> elapsed = end_time - start_time; |
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.
计算慢请求日志的时候,有一个命令处理的总耗时,包括队列排队 + 命令处理 + 写binlog,我理解这个耗时应该是统计这个值。
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
src/pika_client_conn.cc
Outdated
void PikaClientConn::ProcessSlowlog(const PikaCmdArgsType& argv, std::shared_ptr<Cmd> c_ptr) { | ||
void PikaClientConn::ProcessSlowlog(const PikaCmdArgsType& argv, std::shared_ptr<Cmd> c_ptr, std::string opt) { | ||
if (time_stat_->total_time() > g_pika_conf->slowlog_slower_than()) { | ||
auto slow_command_count = g_pika_cmd_table_manager->GetSlowCommandCount(); |
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.
这里操作slow_command_count是不得加锁?
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
std::shared_mutex histograms_mutex_; | ||
std::shared_mutex slow_command_mutex_; | ||
std::shared_ptr<prometheus::Registry> prometheus_registry_; | ||
prometheus::Family<prometheus::Histogram>* histogram_family_; |
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.
historgram_family_,histograms_里的元素这些指针,需要delete吗?
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.
这里的指针是由 prometheus_registry_ 管理的,析构的时候会由 prometheus_registry_ 统一释放
This reverts commit 57585f7.
* Added time statistics for P99 and slow commands --------- Co-authored-by: wuxianrong <wuxianrong@360.cn>
* Added time statistics for P99 and slow commands --------- Co-authored-by: wuxianrong <wuxianrong@360.cn>
…" (OpenAtomFoundation#3053) This reverts commit 57585f7.
Uh oh!
There was an error while loading. Please reload this page.