提交 7d38ea3d 编写于 作者: K KernelMaker

more detailed slow-log

上级 10f384c8
......@@ -123,7 +123,18 @@ std::string PikaClientConn::DoCmd(const std::string& opt) {
if (g_pika_conf->slowlog_slower_than() >= 0) {
int64_t duration = slash::NowMicros() - start_us;
if (duration > g_pika_conf->slowlog_slower_than()) {
LOG(ERROR) << "command:" << opt << ", start_time(s): " << start_us / 1000000 << ", duration(us): " << duration;
std::string slow_log;
for (int i = 0; i < argv_.size(); i++) {
slow_log.append(" ");
slow_log.append(slash::ToRead(argv_[i]));
if (slow_log.size() >= 1000) {
slow_log.resize(1000);
slow_log.append("...\"");
break;
}
}
LOG(ERROR) << "command:" << slow_log << ", start_time(s): " << start_us / 1000000 << ", duration(us): " << duration;
// LOG(ERROR) << "command:" << opt << ", start_time(s): " << start_us / 1000000 << ", duration(us): " << duration;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册