diff --git a/src-tauri/src/proxy.rs b/src-tauri/src/proxy.rs index a0ff37e..ab721b8 100644 --- a/src-tauri/src/proxy.rs +++ b/src-tauri/src/proxy.rs @@ -1244,7 +1244,36 @@ mod macmon_sampler { pub fn get_metrics() -> Option { None } } -pub use super::SystemStatsResponse; +#[derive(serde::Serialize, serde::Deserialize)] +pub struct SystemStatsResponse { + pub cpu_used_percent: f64, + pub memory_used_percent: f64, + pub memory_available_mb: u64, + pub memory_total_mb: u64, + pub swap_used_percent: f64, + pub swap_available_mb: u64, + pub swap_total_mb: u64, + pub gpu_available: bool, + pub gpu_utilization: Option, + pub gpu_memory_used_pct: Option, + pub ane_available: bool, + pub ane_utilization: Option, + pub source: String, + pub chip_name: Option, + pub cpu_power: Option, + pub gpu_power: Option, + pub ane_power: Option, + pub sys_power: Option, + pub ram_power: Option, + pub cpu_temp: Option, + pub gpu_temp: Option, + pub ecpu_freq_mhz: Option, + pub pcpu_freq_mhz: Option, + pub gpu_freq_mhz: Option, + pub ecpu_cores: Option, + pub pcpu_cores: Option, + pub gpu_cores: Option, +} async fn get_system_stats_handler() -> Response { // 1. Try macmon first (Apple Silicon only) diff --git a/src-tauri/src/validate.rs b/src-tauri/src/validate.rs index 8e58227..18454be 100644 --- a/src-tauri/src/validate.rs +++ b/src-tauri/src/validate.rs @@ -5,6 +5,8 @@ use std::path::Path; use std::process::Command; use std::time::{SystemTime, UNIX_EPOCH}; +use super::proxy::SystemStatsResponse; + #[derive(Debug, Clone, Serialize, Deserialize)] pub enum ValidationStatus { Pass, @@ -282,7 +284,7 @@ pub fn validate_thermal_state_via_pmset() -> Option { // ==================== Main Validation Function ==================== -pub fn run_validation(layers: &[u32], macmon_stats: &super::SystemStatsResponse) -> ValidationResult { +pub fn run_validation(layers: &[u32], macmon_stats: &SystemStatsResponse) -> ValidationResult { write_log(&format!("[INFO] Validation started: layers={:?}", layers)); let mut result = ValidationResult {