Skip to content

Commit

Permalink
fix core
Browse files Browse the repository at this point in the history
  • Loading branch information
KayzzzZ committed Dec 16, 2024
1 parent 011b1c6 commit 428f620
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion core/ebpf/eBPFServer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -167,10 +167,10 @@ void eBPFServer::Init() {
auto configJson = AppConfig::GetInstance()->GetConfig();
mAdminConfig.LoadEbpfConfig(configJson);
mEventCB = std::make_unique<EventHandler>(nullptr, -1, 0);
mHostMetadataCB = std::make_unique<HostMetadataHandler>(nullptr, -1, 0);
#ifdef __ENTERPRISE__
mMeterCB = std::make_unique<ArmsMeterHandler>(nullptr, -1, 0);
mSpanCB = std::make_unique<ArmsSpanHandler>(nullptr, -1, 0);
mHostMetadataCB = std::make_unique<HostMetadataHandler>(nullptr, -1, 0);
mHostMetadataCB->RegisterUpdatePluginCallback([&](nami::PluginType type, UpdataType updateType, const std::variant<SecurityOptions*, nami::ObserverNetworkOption*> ops) {
return UpdatePlugin(type, updateType, ops);
});
Expand Down
8 changes: 4 additions & 4 deletions core/unittest/ebpf/eBPFServerUnittest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -596,24 +596,24 @@ void eBPFServerUnittest::TestEnableNetworkPlugin() {
std::string errorMsg;
Json::Value configJson, optionalGoPipeline;
APSARA_TEST_TRUE(ParseJsonTable(configStr, configJson, errorMsg));
std::cout << "1" ;
std::cout << "1" << std::endl;
nami::ObserverNetworkOption network_option;
bool res = ebpf::InitObserverNetworkOption(configJson, network_option, &ctx, "test");
EXPECT_TRUE(res);
std::cout << "2" ;
std::cout << "2" << std::endl;
// observer_options.Init(ObserverType::NETWORK, configJson, &ctx, "test");
std::shared_ptr<InputNetworkObserver> input(new InputNetworkObserver());
input->SetContext(ctx);
input->SetMetricsRecordRef("test", "1");
std::cout << "3" ;
std::cout << "3" << std::endl;
auto initStatus = input->Init(configJson, optionalGoPipeline);
EXPECT_TRUE(initStatus);
res = ebpf::eBPFServer::GetInstance()->EnablePlugin(
"test", 1,
nami::PluginType::NETWORK_OBSERVE,
&ctx,
&network_option, input->mPluginMgr);
std::cout << "4" ;
std::cout << "4" << std::endl;
EXPECT_EQ(ebpf::eBPFServer::GetInstance()->mMonitorMgr->mInited[int(nami::PluginType::NETWORK_OBSERVE)], true);
auto& mgr = ebpf::eBPFServer::GetInstance()->mMonitorMgr->mSelfMonitors[int(nami::PluginType::NETWORK_OBSERVE)];
auto mgrPtr = mgr.get();
Expand Down

0 comments on commit 428f620

Please sign in to comment.