Add static CPU model and core count to CPU collector
All checks were successful
Build and Release / build-and-release (push) Successful in 1m47s

- Collect CPU model name and core count from /proc/cpuinfo
- Only collect once at startup (check if fields already set)
- Display below C-state row in dashboard CPU section
- Move CPU info collection from NixOS collector to CPU collector
This commit is contained in:
2025-12-01 19:15:57 +01:00
parent 5c3ac8b15e
commit 5bc250a738
6 changed files with 70 additions and 4 deletions

View File

@@ -1,6 +1,6 @@
[package]
name = "cm-dashboard-shared"
version = "0.1.239"
version = "0.1.240"
edition = "2021"
[dependencies]

View File

@@ -57,6 +57,11 @@ pub struct CpuData {
pub temperature_celsius: Option<f32>,
pub load_status: Status,
pub temperature_status: Status,
// Static CPU information (collected once at startup)
#[serde(skip_serializing_if = "Option::is_none")]
pub model_name: Option<String>,
#[serde(skip_serializing_if = "Option::is_none")]
pub core_count: Option<u32>,
}
/// Memory monitoring data
@@ -219,6 +224,8 @@ impl AgentData {
temperature_celsius: None,
load_status: Status::Unknown,
temperature_status: Status::Unknown,
model_name: None,
core_count: None,
},
memory: MemoryData {
usage_percent: 0.0,