Fix physical drive grouping logic for unified pool visualization
All checks were successful
Build and Release / build-and-release (push) Successful in 2m11s
All checks were successful
Build and Release / build-and-release (push) Successful in 2m11s
Updated filesystem grouping to use extract_base_device method for proper partition-to-drive mapping. This ensures nvme0n1p1 and nvme0n1p2 are correctly grouped under nvme0n1 drive pool instead of separate pools.
This commit is contained in:
parent
0e8b149718
commit
7a3ee3d5ba
6
Cargo.lock
generated
6
Cargo.lock
generated
@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d"
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.107"
|
||||
version = "0.1.108"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"chrono",
|
||||
@ -301,7 +301,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.107"
|
||||
version = "0.1.108"
|
||||
dependencies = [
|
||||
"anyhow",
|
||||
"async-trait",
|
||||
@ -324,7 +324,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.107"
|
||||
version = "0.1.108"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"serde",
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-agent"
|
||||
version = "0.1.108"
|
||||
version = "0.1.109"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -419,13 +419,22 @@ impl DiskCollector {
|
||||
// Get the physical drive name for this mount point
|
||||
if let Some(devices) = self.detected_devices.get(&fs.mount_point) {
|
||||
if let Some(device_name) = devices.first() {
|
||||
// Extract drive name (e.g., "nvme0n1" from "nvme0n1")
|
||||
let drive_name = device_name.clone();
|
||||
// Extract base drive name from detected device
|
||||
let drive_name = Self::extract_base_device(device_name)
|
||||
.unwrap_or_else(|| device_name.clone());
|
||||
|
||||
debug!("Grouping filesystem {} (device: {}) under drive: {}",
|
||||
fs.mount_point, device_name, drive_name);
|
||||
|
||||
grouped.entry(drive_name).or_insert_with(Vec::new).push(fs.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
debug!("Filesystem grouping result: {} drives with filesystems: {:?}",
|
||||
grouped.len(),
|
||||
grouped.keys().collect::<Vec<_>>());
|
||||
|
||||
Ok(grouped)
|
||||
}
|
||||
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard"
|
||||
version = "0.1.108"
|
||||
version = "0.1.109"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "cm-dashboard-shared"
|
||||
version = "0.1.108"
|
||||
version = "0.1.109"
|
||||
edition = "2021"
|
||||
|
||||
[dependencies]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user