-
Notifications
You must be signed in to change notification settings - Fork 393
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: support host monitor #1890
base: main
Are you sure you want to change the base?
Conversation
6150e52
to
bfdd9c2
Compare
4110e3d
to
3e12438
Compare
targetEvent->SetContent("binary", sourceEvent.GetContent(DEFAULT_CONTENT_KEY_PROCESS_BINARY)); | ||
targetEvent->SetContent("arguments", sourceEvent.GetContent(DEFAULT_CONTENT_KEY_PROCESS_ARGUMENTS)); | ||
targetEvent->SetContent("language", sourceEvent.GetContent(DEFAULT_CONTENT_KEY_PROCESS_LANGUAGE)); | ||
targetEvent->SetContent("containerID", sourceEvent.GetContent(DEFAULT_CONTENT_KEY_PROCESS_CONTAINER_ID)); |
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.
需要统一到constans里字段。需要避免同一场景一会下划线,一会大小写的问题。
class ProcessCollector : public BaseCollector { | ||
public: | ||
ProcessCollector() : mProcessSilentCount(INT32_FLAG(process_collect_silent_count)) { | ||
mName = "process"; |
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.
多处使用的字符串,避免直接使用字符串
|
||
namespace logtail { | ||
|
||
const std::string ProcessorHostMetaNative::sName = "processor_host_meta_native"; |
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.
inner processor存在的必要性是什么?为什么不能collect时直接补充字段
const auto now = steady_clock::now(); | ||
|
||
// TODO: more accurate cache | ||
auto prev = GetPreProcessStat(pid); |
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.
|
||
int readCount = 0; | ||
WalkAllProcess(PROCESS_DIR, [&](const std::string& dirName) { | ||
if (++readCount > mProcessSilentCount) { |
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.
个数控制是不是也在控制缓存里的?不应该只是控制去直接操作系统交互的吗
TODO: