Skip to content

Commit

Permalink
change parameters name
Browse files Browse the repository at this point in the history
  • Loading branch information
Takuka0311 committed Sep 26, 2024
1 parent 8f6e7fe commit 121b468
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion core/file_server/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ bool ConfigManager::IsUpdateContainerPaths() {
// return false if s_lastUpdateCount >= INT32_FLAG(max_docker_config_update_times) and last update time is in same
// window
return false;
/********************************************************************************/
/************************************************************************************************************************/
}

bool ConfigManager::UpdateContainerStopped(ConfigContainerInfoUpdateCmd* cmd) {
Expand Down
4 changes: 2 additions & 2 deletions core/pipeline/plugin/instance/ProcessorInstance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ bool ProcessorInstance::Init(const Json::Value& config, PipelineContext& context
mOutEventGroupsTotal = mPlugin->GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_OUT_EVENT_GROUPS_TOTAL);
mInSizeBytes = mPlugin->GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_IN_SIZE_BYTES);
mOutSizeBytes = mPlugin->GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_OUT_SIZE_BYTES);
mCostTimeMS = mPlugin->GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_TOTAL_PROCESS_TIME_MS);
mTotalProcessTimeMs = mPlugin->GetMetricsRecordRef().CreateCounter(METRIC_PLUGIN_TOTAL_PROCESS_TIME_MS);

return true;
}
Expand All @@ -57,7 +57,7 @@ void ProcessorInstance::Process(vector<PipelineEventGroup>& logGroupList) {

auto before = chrono::system_clock::now();
mPlugin->Process(logGroupList);
mCostTimeMS->Add(chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now() - before).count());
mTotalProcessTimeMs->Add(chrono::duration_cast<chrono::milliseconds>(chrono::system_clock::now() - before).count());

for (const auto& logGroup : logGroupList) {
mOutEventsTotal->Add(logGroup.GetEvents().size());
Expand Down
2 changes: 1 addition & 1 deletion core/pipeline/plugin/instance/ProcessorInstance.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class ProcessorInstance : public PluginInstance {
CounterPtr mOutEventGroupsTotal;
CounterPtr mInSizeBytes;
CounterPtr mOutSizeBytes;
CounterPtr mCostTimeMS;
CounterPtr mTotalProcessTimeMs;

#ifdef APSARA_UNIT_TEST_MAIN
friend class ProcessorInstanceUnittest;
Expand Down
12 changes: 6 additions & 6 deletions core/unittest/processor/ProcessorParseJsonNativeUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessJsonEscapedNullByte() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

void ProcessorParseJsonNativeUnittest::TestProcessJson() {
Expand Down Expand Up @@ -394,7 +394,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessJson() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

void ProcessorParseJsonNativeUnittest::TestProcessJsonContent() {
Expand Down Expand Up @@ -485,7 +485,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessJsonContent() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

void ProcessorParseJsonNativeUnittest::TestProcessJsonRaw() {
Expand Down Expand Up @@ -574,7 +574,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessJsonRaw() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

void ProcessorParseJsonNativeUnittest::TestProcessEventKeepUnmatch() {
Expand Down Expand Up @@ -641,7 +641,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessEventKeepUnmatch() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

void ProcessorParseJsonNativeUnittest::TestProcessEventDiscardUnmatch() {
Expand Down Expand Up @@ -695,7 +695,7 @@ void ProcessorParseJsonNativeUnittest::TestProcessEventDiscardUnmatch() {

std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL("null", CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), uint64_t(0));
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), uint64_t(0));
}

} // namespace logtail
Expand Down
6 changes: 3 additions & 3 deletions core/unittest/processor/ProcessorParseRegexNativeUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ void ProcessorParseRegexNativeUnittest::TestProcessRegex() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), 0);
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), 0);
}

void ProcessorParseRegexNativeUnittest::TestProcessRegexRaw() {
Expand Down Expand Up @@ -297,7 +297,7 @@ void ProcessorParseRegexNativeUnittest::TestProcessRegexRaw() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), 0);
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), 0);
}

void ProcessorParseRegexNativeUnittest::TestProcessRegexContent() {
Expand Down Expand Up @@ -373,7 +373,7 @@ void ProcessorParseRegexNativeUnittest::TestProcessRegexContent() {
})";
std::string outJson = eventGroupList[0].ToJsonString();
APSARA_TEST_STREQ_FATAL(CompactJson(expectJson).c_str(), CompactJson(outJson).c_str());
APSARA_TEST_GE_FATAL(processorInstance.mCostTimeMS->GetValue(), 0);
APSARA_TEST_GE_FATAL(processorInstance.mTotalProcessTimeMs->GetValue(), 0);
}

void ProcessorParseRegexNativeUnittest::TestAddLog() {
Expand Down

0 comments on commit 121b468

Please sign in to comment.