From c62c7fa6986a2841ab5727c42a50fa84214348a4 Mon Sep 17 00:00:00 2001 From: Christoffer Martinsson Date: Sun, 30 Nov 2025 00:44:38 +0100 Subject: [PATCH] Remove debug logging from disk collector Removed all debug! statements from disk collector to reduce log noise. Bump version to v0.1.226 --- Cargo.lock | 6 +++--- agent/Cargo.toml | 2 +- agent/src/collectors/disk.rs | 24 +++++------------------- dashboard/Cargo.toml | 2 +- shared/Cargo.toml | 2 +- 5 files changed, 11 insertions(+), 25 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 0efcc65..a80d923 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -279,7 +279,7 @@ checksum = "a1d728cc89cf3aee9ff92b05e62b19ee65a02b5702cff7d5a377e32c6ae29d8d" [[package]] name = "cm-dashboard" -version = "0.1.224" +version = "0.1.225" dependencies = [ "anyhow", "chrono", @@ -301,7 +301,7 @@ dependencies = [ [[package]] name = "cm-dashboard-agent" -version = "0.1.224" +version = "0.1.225" dependencies = [ "anyhow", "async-trait", @@ -325,7 +325,7 @@ dependencies = [ [[package]] name = "cm-dashboard-shared" -version = "0.1.224" +version = "0.1.225" dependencies = [ "chrono", "serde", diff --git a/agent/Cargo.toml b/agent/Cargo.toml index 515fce3..9026c71 100644 --- a/agent/Cargo.toml +++ b/agent/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-agent" -version = "0.1.225" +version = "0.1.226" edition = "2021" [dependencies] diff --git a/agent/src/collectors/disk.rs b/agent/src/collectors/disk.rs index f377c0d..bc40c33 100644 --- a/agent/src/collectors/disk.rs +++ b/agent/src/collectors/disk.rs @@ -5,9 +5,7 @@ use cm_dashboard_shared::{AgentData, DriveData, FilesystemData, PoolData, Hyster use crate::config::DiskConfig; use tokio::process::Command as TokioCommand; use std::process::Command as StdCommand; -use std::time::Instant; use std::collections::HashMap; -use tracing::debug; use super::{Collector, CollectorError}; @@ -68,9 +66,6 @@ impl DiskCollector { /// Collect all storage data and populate AgentData async fn collect_storage_data(&self, agent_data: &mut AgentData) -> Result<(), CollectorError> { - let start_time = Instant::now(); - debug!("Starting clean storage collection"); - // Step 1: Get mount points and their backing devices let mount_devices = self.get_mount_devices().await?; @@ -105,9 +100,6 @@ impl DiskCollector { self.populate_drives_data(&physical_drives, &smart_data, agent_data)?; self.populate_pools_data(&mergerfs_pools, &smart_data, agent_data)?; - let elapsed = start_time.elapsed(); - debug!("Storage collection completed in {:?}", elapsed); - Ok(()) } @@ -142,7 +134,6 @@ impl DiskCollector { } } - debug!("Found {} mounted block devices", mount_devices.len()); Ok(mount_devices) } @@ -155,8 +146,8 @@ impl DiskCollector { Ok((total, used)) => { filesystem_usage.insert(mount_point.clone(), (total, used)); } - Err(e) => { - debug!("Failed to get filesystem info for {}: {}", mount_point, e); + Err(_e) => { + // Silently skip filesystems we can't read } } } @@ -177,8 +168,6 @@ impl DiskCollector { // Only add if we don't already have usage data for this mount point if !filesystem_usage.contains_key(&mount_point) { if let Ok((total, used)) = self.get_filesystem_info(&mount_point) { - debug!("Added MergerFS filesystem usage for {}: {}GB total, {}GB used", - mount_point, total as f32 / (1024.0 * 1024.0 * 1024.0), used as f32 / (1024.0 * 1024.0 * 1024.0)); filesystem_usage.insert(mount_point, (total, used)); } } @@ -253,9 +242,8 @@ impl DiskCollector { } else { mount_point.trim_start_matches('/').replace('/', "_") }; - + if pool_name.is_empty() { - debug!("Skipping mergerfs pool with empty name: {}", mount_point); continue; } @@ -283,8 +271,7 @@ impl DiskCollector { // Categorize as data vs parity drives let (data_drives, parity_drives) = match self.categorize_pool_drives(&all_member_paths) { Ok(drives) => drives, - Err(e) => { - debug!("Failed to categorize drives for pool {}: {}. Skipping.", mount_point, e); + Err(_e) => { continue; } }; @@ -299,8 +286,7 @@ impl DiskCollector { }); } } - - debug!("Found {} mergerfs pools", pools.len()); + Ok(pools) } diff --git a/dashboard/Cargo.toml b/dashboard/Cargo.toml index baf6080..c694a01 100644 --- a/dashboard/Cargo.toml +++ b/dashboard/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard" -version = "0.1.225" +version = "0.1.226" edition = "2021" [dependencies] diff --git a/shared/Cargo.toml b/shared/Cargo.toml index fa92dd2..701737e 100644 --- a/shared/Cargo.toml +++ b/shared/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cm-dashboard-shared" -version = "0.1.225" +version = "0.1.226" edition = "2021" [dependencies]