wmi müsst jz gneutz werden aber des was für morgne
This commit is contained in:
@@ -13,7 +13,6 @@ tokio = { version = "1.37", features = ["full"] }
|
|||||||
local-ip-address = "0.5"
|
local-ip-address = "0.5"
|
||||||
reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "cookies", "rustls-tls"] }
|
reqwest = { version = "0.11", default-features = false, features = ["json", "blocking", "cookies", "rustls-tls"] }
|
||||||
sysinfo = "0.36.1"
|
sysinfo = "0.36.1"
|
||||||
heim = "0.0.11"
|
|
||||||
metrics = "0.24.2"
|
metrics = "0.24.2"
|
||||||
chrono = "0.4"
|
chrono = "0.4"
|
||||||
nvml-wrapper = "0.10"
|
nvml-wrapper = "0.10"
|
||||||
|
@@ -1,5 +1,4 @@
|
|||||||
//use chrono::Utc;
|
//use chrono::Utc;
|
||||||
use heim::sensors;
|
|
||||||
use nvml_wrapper::Nvml;
|
use nvml_wrapper::Nvml;
|
||||||
use reqwest::{Client, StatusCode};
|
use reqwest::{Client, StatusCode};
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
@@ -415,33 +414,17 @@ impl MetricsCollector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
fn get_cpu_temp() -> Option<f32> {
|
fn get_cpu_temp() -> Option<f32> {
|
||||||
/*println!("Attempting to get CPU temperature...");
|
println!("Attempting to get CPU temperature...");
|
||||||
let components = Components::new_with_refreshed_list();
|
let mut sys = System::new_all();
|
||||||
for component in &components {
|
//let components = Components::new_with_refreshed_list();
|
||||||
|
sys.refresh_all();
|
||||||
|
for component in sys.components() {
|
||||||
if let Some(temperature) = component.temperature() {
|
if let Some(temperature) = component.temperature() {
|
||||||
println!("{temperature}°C");
|
println!("{temperature}°C");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Some(0.0) // Placeholder, actual implementation depends on platform*/
|
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::<heim::units::thermodynamic_temperature::degree_celsius>(),
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
None
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Reference in New Issue
Block a user