-
Notifications
You must be signed in to change notification settings - Fork 58
perf-counter: add remote command to get perf-counters by substr/prefi… #261
Conversation
info.timestamp = _timestamp; | ||
char buf[20]; | ||
utils::time_ms_to_date_time(info.timestamp * 1000, buf, sizeof(buf)); | ||
info.timestamp_str = buf; |
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.
这个结构里面有两个timestamp? 能干掉一个吗
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.
这个当时就是为了便于阅读,所以特意放了个timestamp_str,都保留问题不大
} | ||
}; | ||
iterate_snapshot(visitor); | ||
info.result = "OK"; |
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.
移到info
变量的定义后面一行吧
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.
为了和 by_regexp() 函数里面看起来比较一致
@@ -47,11 +47,45 @@ perf_counters::perf_counters() | |||
{ | |||
command_manager::instance().register_command( | |||
{"perf-counters"}, | |||
"perf-counters - query perf counters, supporting filter by POSIX basic regular expressions", | |||
"perf-counters [name-filter]...", | |||
"perf-counters - query perf counters, filtered by OR of POSIX basic regular expressions", |
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.
filtered by 就对了,不需要 OR of,下面同理,加 OR of 原因是什么
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.
用户指定多个的话,是或关系,不是与关系
}); | ||
}); | ||
command_manager::instance().register_command( | ||
{"perf-counters-by-postfix"}, |
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.
suffix,不是 postfix
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.
postfix也是后缀的意思。而且我们之前的各种用法都是postfix,那就都一致吧
…x/postfix