From 67283a85cf684858098e512f077804a5273e6643 Mon Sep 17 00:00:00 2001 From: abingcbc Date: Wed, 26 Feb 2025 23:45:21 +0800 Subject: [PATCH] fix --- core/host_monitor/HostMonitorInputRunner.cpp | 2 +- core/host_monitor/HostMonitorInputRunner.h | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/core/host_monitor/HostMonitorInputRunner.cpp b/core/host_monitor/HostMonitorInputRunner.cpp index bacdc09b40..91866bf3f2 100755 --- a/core/host_monitor/HostMonitorInputRunner.cpp +++ b/core/host_monitor/HostMonitorInputRunner.cpp @@ -151,7 +151,7 @@ void HostMonitorInputRunner::ScheduleOnce(const std::chrono::steady_clock::time_ config.mCollectorName)); return; } - if (collector->second.mCollector->Collect(config, &group)) { + if (collector->second.Collect(config, &group)) { LOG_DEBUG( sLogger, ("host monitor", "collect data")("collector", config.mCollectorName)("size", group.GetEvents().size())); diff --git a/core/host_monitor/HostMonitorInputRunner.h b/core/host_monitor/HostMonitorInputRunner.h index de1435a521..874e708476 100644 --- a/core/host_monitor/HostMonitorInputRunner.h +++ b/core/host_monitor/HostMonitorInputRunner.h @@ -47,12 +47,14 @@ class CollectorInstance { bool IsValidEvent(const std::chrono::steady_clock::time_point& execTime) const { return mIsEnabled && execTime >= mLastEnableTime; } - - std::unique_ptr mCollector; + bool Collect(const HostMonitorTimerEvent::CollectConfig& collectConfig, PipelineEventGroup* group) { + return mCollector->Collect(collectConfig, group); + } private: bool mIsEnabled = false; std::chrono::steady_clock::time_point mLastEnableTime; + std::unique_ptr mCollector; }; class HostMonitorInputRunner : public InputRunner {