Skip to content
This repository has been archived by the owner on Jun 23, 2022. It is now read-only.

perf-counter: add remote command to get perf-counters by substr/prefi… #261

Merged
merged 2 commits into from
Jun 17, 2019

Conversation

qinzuoyan
Copy link
Member

…x/postfix

info.timestamp = _timestamp;
char buf[20];
utils::time_ms_to_date_time(info.timestamp * 1000, buf, sizeof(buf));
info.timestamp_str = buf;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这个结构里面有两个timestamp? 能干掉一个吗

Copy link
Member Author

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";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

移到info变量的定义后面一行吧

Copy link
Member Author

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",
Copy link
Contributor

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 原因是什么

Copy link
Member Author

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"},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

suffix,不是 postfix

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

postfix也是后缀的意思。而且我们之前的各种用法都是postfix,那就都一致吧

@qinzuoyan qinzuoyan merged commit b8bfc1c into XiaoMi:master Jun 17, 2019
@qinzuoyan qinzuoyan deleted the qinzuoyan branch June 17, 2019 10:38
acelyc111 added a commit that referenced this pull request Jun 17, 2019
This was referenced Jun 20, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants