Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Abingcbc committed Feb 26, 2025
1 parent 352f7da commit 67283a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion core/host_monitor/HostMonitorInputRunner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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()));
Expand Down
6 changes: 4 additions & 2 deletions core/host_monitor/HostMonitorInputRunner.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,14 @@ class CollectorInstance {
bool IsValidEvent(const std::chrono::steady_clock::time_point& execTime) const {
return mIsEnabled && execTime >= mLastEnableTime;
}

std::unique_ptr<BaseCollector> 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<BaseCollector> mCollector;
};

class HostMonitorInputRunner : public InputRunner {
Expand Down

0 comments on commit 67283a8

Please sign in to comment.