diff --git a/bob/src/api/mod.rs b/bob/src/api/mod.rs index 11939a96..1879f0e5 100644 --- a/bob/src/api/mod.rs +++ b/bob/src/api/mod.rs @@ -352,9 +352,9 @@ async fn get_space_info( Ok(Json(SpaceInfo { total_space: Space { - total_disk_space_bytes: disk_metrics.total_space, - used_disk_space_bytes: disk_metrics.used_space, - free_disk_space_bytes: disk_metrics.free_space, + total_disk_space_bytes: disk_metrics.total.total_space, + used_disk_space_bytes: disk_metrics.total.used_space, + free_disk_space_bytes: disk_metrics.total.free_space, }, occupied_disk_space_bytes: occupied_disk_space_by_disk.values().sum(), occupied_disk_space_by_disk, diff --git a/bob/src/hw_metrics_collector.rs b/bob/src/hw_metrics_collector.rs index ecc7cfe3..8a6e0efd 100644 --- a/bob/src/hw_metrics_collector.rs +++ b/bob/src/hw_metrics_collector.rs @@ -20,9 +20,7 @@ const DISK_STAT_FILE: &str = "/proc/diskstats"; #[derive(Debug, Clone)] pub(crate) struct DiskSpaceMetrics { - pub(crate) total_space: u64, - pub(crate) used_space: u64, - pub(crate) free_space: u64, + pub(crate) total: SpaceMetrics, pub(crate) per_disk: HashMap } @@ -145,7 +143,14 @@ impl HWMetricsCollector { gauge!(TOTAL_SPACE, bytes_to_mb(total_space) as f64); gauge!(USED_SPACE, bytes_to_mb(used_space) as f64); gauge!(FREE_SPACE, bytes_to_mb(free_space) as f64); - DiskSpaceMetrics { total_space, used_space, free_space, per_disk: disks_metrics } + DiskSpaceMetrics { + total: SpaceMetrics { + total_space, + used_space, + free_space, + }, + per_disk: disks_metrics, + } } fn to_cpath(path: &Path) -> Vec {