Skip to content

Commit

Permalink
feat: textparser with simd
Browse files Browse the repository at this point in the history
  • Loading branch information
catdogpandas committed Dec 17, 2024
1 parent de02789 commit 732cd9f
Show file tree
Hide file tree
Showing 10 changed files with 286 additions and 1,112 deletions.
2 changes: 2 additions & 0 deletions core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ endif ()

if (NOT WITHSPL)
add_definitions(-D__EXCLUDE_SPL__)
else ()
add_definitions(-D__ENABLE_SSE4_2__)
endif()

# Default C/CXX flags.
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

0 comments on commit 732cd9f

Please sign in to comment.