diff --git a/WatcherAgent/Cargo.toml b/WatcherAgent/Cargo.toml index e649e4a..edf74c3 100644 --- a/WatcherAgent/Cargo.toml +++ b/WatcherAgent/Cargo.toml @@ -13,7 +13,6 @@ tokio = { version = "1.37", features = ["full"] } local-ip-address = "0.5" reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "cookies", "rustls-tls"] } sysinfo = "0.36.1" -heim = "0.0.11" metrics = "0.24.2" chrono = "0.4" nvml-wrapper = "0.10" diff --git a/WatcherAgent/src/main.rs b/WatcherAgent/src/main.rs index b0b4b34..d5341e6 100644 --- a/WatcherAgent/src/main.rs +++ b/WatcherAgent/src/main.rs @@ -1,5 +1,4 @@ //use chrono::Utc; -use heim::sensors; use nvml_wrapper::Nvml; use reqwest::{Client, StatusCode}; use serde::{Deserialize, Serialize}; @@ -415,33 +414,17 @@ impl MetricsCollector { } fn get_cpu_temp() -> Option { - /*println!("Attempting to get CPU temperature..."); - let components = Components::new_with_refreshed_list(); - for component in &components { + println!("Attempting to get CPU temperature..."); + let mut sys = System::new_all(); + //let components = Components::new_with_refreshed_list(); + sys.refresh_all(); + for component in sys.components() { if let Some(temperature) = component.temperature() { println!("{temperature}°C"); } } - Some(0.0) // Placeholder, actual implementation depends on platform*/ - let mut temperatures = sensors::temperatures(); - while let Some(sensor) = temperatures.next().await { - if let Ok(sensor) = sensor { - if sensor.unit() == heim::units::thermodynamic_temperature::DegreeCelsius { - if let Some(label) = sensor.label() { - if label.contains("CPU") || label.contains("Tdie") || label.contains("Package") - { - return Some( - sensor - .current() - .get::(), - ); - } - } - } - } - } - None + Some(0.0) // Placeholder, actual implementation depends on platform } /*