-
Notifications
You must be signed in to change notification settings - Fork 419
feat: Add inner processor to parse PipelineEventGroup pb #2259
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
base: main
Are you sure you want to change the base?
Conversation
This reverts commit eb5adfd.
0dbccf2
to
9795e83
Compare
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.
Pull Request Overview
This PR introduces a new inner processor, ProcessorParseFromPBNative, to parse PipelineEventGroup protobuf data and adds corresponding unit tests. Key changes include:
- Implementation of the processor in new header and source files.
- Addition of unit tests in ProcessorParseFromPBNativeUnittest.cpp covering valid, non-raw, and invalid events.
- Updates to the CMake build configuration to include the new test target.
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
core/unittest/processor/ProcessorParseFromPBNativeUnittest.cpp | New unit tests for verifying processor behavior with various input cases |
core/unittest/processor/CMakeLists.txt | Added executable and test discovery entry for the new processor |
core/plugin/processor/inner/ProcessorParseFromPBNative.h | Declaration of the new processor with required interfaces |
core/plugin/processor/inner/ProcessorParseFromPBNative.cpp | Implementation of processor parsing logic and event handling |
LOG_WARNING(sLogger, ("unsupported event type", "pipelineEventGroup is empty")); | ||
return; | ||
} | ||
const auto& e = eventGroup.GetEvents().at(0); |
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.
这里可以看下ProcessorSPL,Process支持传入std::vector& logGroupList,一进多出。Events里面再设置只拿一个,不太合理
if (pbGroup.ParseFromString(sourceEvent.GetContent().data())) { | ||
eventGroup.MutableEvents().clear(); | ||
TransferPBToPipelineEventGroup(pbGroup, eventGroup, errMsg); | ||
} else { |
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.
这里else是不是可以和if (!errMsg.empty()) 合并起来,处理成功一个分支,其他是另一个分支。否则这里也是需要打印LOG_WARNING的
UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessValidSpanData) | ||
UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessNonRawEvent) | ||
UNIT_TEST_CASE(ProcessorParseFromPBNativeUnittest, TestProcessInvalidProtobufData) | ||
|
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.
序列化我们认为是会比较耗时的话,建议这里加一个benchmark,可以参考SplBenchmark
No description provided.