Skip to content
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: prom textparser with simd #1947

Open
wants to merge 12 commits into
base: main
Choose a base branch
from
2 changes: 1 addition & 1 deletion core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ else ()
endif ()

if (NOT WITHSPL)
add_definitions(-D__EXCLUDE_SPL__)
add_definitions(-D__EXCLUDE_SSE4_2__)
endif()

# Default C/CXX flags.
Expand Down
4 changes: 2 additions & 2 deletions core/pipeline/plugin/PluginRegistry.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
#include "plugin/processor/inner/ProcessorSplitLogStringNative.h"
#include "plugin/processor/inner/ProcessorSplitMultilineLogStringNative.h"
#include "plugin/processor/inner/ProcessorTagNative.h"
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SPL__)
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SSE4_2__)
#include "plugin/processor/ProcessorSPL.h"
#endif

Expand Down Expand Up @@ -154,7 +154,7 @@ void PluginRegistry::LoadStaticPlugins() {
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorFilterNative>());
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorPromParseMetricNative>());
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorPromRelabelMetricNative>());
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SPL__)
#if defined(__linux__) && !defined(__ANDROID__) && !defined(__EXCLUDE_SSE4_2__)
if (BOOL_FLAG(enable_processor_spl)) {
RegisterProcessorCreator(new StaticProcessorCreator<ProcessorSPL>());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ void ProcessorPromParseMetricNative::Process(PipelineEventGroup& eGroup) {
auto timestampMilliSec = StringTo<uint64_t>(scrapeTimestampMilliSecStr.to_string());
auto timestamp = timestampMilliSec / 1000;
auto nanoSec = timestampMilliSec % 1000 * 1000000;
TextParser parser(mScrapeConfigPtr->mHonorTimestamps);
prom::TextParser parser(mScrapeConfigPtr->mHonorTimestamps);
parser.SetDefaultTimestamp(timestamp, nanoSec);

for (auto& e : events) {
Expand All @@ -49,7 +49,7 @@ bool ProcessorPromParseMetricNative::IsSupportedEvent(const PipelineEventPtr& e)
bool ProcessorPromParseMetricNative::ProcessEvent(PipelineEventPtr& e,
EventsContainer& newEvents,
PipelineEventGroup& eGroup,
TextParser& parser) {
prom::TextParser& parser) {
if (!IsSupportedEvent(e)) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class ProcessorPromParseMetricNative : public Processor {
bool IsSupportedEvent(const PipelineEventPtr&) const override;

private:
bool ProcessEvent(PipelineEventPtr&, EventsContainer&, PipelineEventGroup&, TextParser& parser);
bool ProcessEvent(PipelineEventPtr&, EventsContainer&, PipelineEventGroup&, prom::TextParser& parser);
std::unique_ptr<ScrapeConfig> mScrapeConfigPtr;

#ifdef APSARA_UNIT_TEST_MAIN
Expand Down
Loading
Loading