Integrate smart collector into metrics manager
All checks were successful
Build and Release / build-and-release (push) Successful in 1m54s
All checks were successful
Build and Release / build-and-release (push) Successful in 1m54s
- Add SmartCollector import and initialization - Enable in both normal and benchmark modes - Fixes infinite smartctl loop issue by properly managing collector - Smart collector now active when config.smart.enabled = true
This commit is contained in:
parent
9160fac80b
commit
59d260680e
@ -4,7 +4,7 @@ use tracing::{error, info};
|
|||||||
|
|
||||||
use crate::collectors::{
|
use crate::collectors::{
|
||||||
backup::BackupCollector, cpu::CpuCollector, disk::DiskCollector, memory::MemoryCollector,
|
backup::BackupCollector, cpu::CpuCollector, disk::DiskCollector, memory::MemoryCollector,
|
||||||
nixos::NixOSCollector, systemd::SystemdCollector, Collector,
|
nixos::NixOSCollector, smart::SmartCollector, systemd::SystemdCollector, Collector,
|
||||||
};
|
};
|
||||||
use crate::config::{AgentConfig, CollectorConfig};
|
use crate::config::{AgentConfig, CollectorConfig};
|
||||||
|
|
||||||
@ -61,6 +61,14 @@ impl MetricCollectionManager {
|
|||||||
info!("BENCHMARK: Backup collector only");
|
info!("BENCHMARK: Backup collector only");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some("smart") => {
|
||||||
|
// SMART collector only
|
||||||
|
if config.smart.enabled {
|
||||||
|
let smart_collector = SmartCollector;
|
||||||
|
collectors.push(Box::new(smart_collector));
|
||||||
|
info!("BENCHMARK: SMART collector only");
|
||||||
|
}
|
||||||
|
}
|
||||||
Some("none") => {
|
Some("none") => {
|
||||||
// No collectors - test agent loop only
|
// No collectors - test agent loop only
|
||||||
info!("BENCHMARK: No collectors enabled");
|
info!("BENCHMARK: No collectors enabled");
|
||||||
@ -101,6 +109,12 @@ impl MetricCollectionManager {
|
|||||||
collectors.push(Box::new(nixos_collector));
|
collectors.push(Box::new(nixos_collector));
|
||||||
info!("NixOS collector initialized");
|
info!("NixOS collector initialized");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if config.smart.enabled {
|
||||||
|
let smart_collector = SmartCollector;
|
||||||
|
collectors.push(Box::new(smart_collector));
|
||||||
|
info!("SMART collector initialized");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user