fix: 暂时禁用 system-stats validation 功能以修复编译错误
问题: - proxy.rs 调用 validate::run_validation - validate.rs 导入 SystemStatsResponse 的路径在不同的二进制模块中不同 - 导致编译错误 临时修复: - 注释掉 proxy.rs 中对 validate 模块的调用 - 在 system-stats API 中直接返回 stats 数据,不进行 validation - 保持基本功能可用 未来改进: - 需要重构模块结构,使 SystemStatsResponse 在所有模块中都可访问 - 或者使用条件编译处理不同的导入路径
This commit is contained in:
@@ -4,39 +4,7 @@ mod proxy;
|
||||
#[path = "../db.rs"]
|
||||
mod db;
|
||||
|
||||
#[path = "../validate.rs"]
|
||||
mod validate;
|
||||
|
||||
#[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<f64>,
|
||||
pub gpu_memory_used_pct: Option<f64>,
|
||||
pub ane_available: bool,
|
||||
pub ane_utilization: Option<f64>,
|
||||
pub source: String,
|
||||
pub chip_name: Option<String>,
|
||||
pub cpu_power: Option<f64>,
|
||||
pub gpu_power: Option<f64>,
|
||||
pub ane_power: Option<f64>,
|
||||
pub sys_power: Option<f64>,
|
||||
pub ram_power: Option<f64>,
|
||||
pub cpu_temp: Option<f64>,
|
||||
pub gpu_temp: Option<f64>,
|
||||
pub ecpu_freq_mhz: Option<u32>,
|
||||
pub pcpu_freq_mhz: Option<u32>,
|
||||
pub gpu_freq_mhz: Option<u32>,
|
||||
pub ecpu_cores: Option<u8>,
|
||||
pub pcpu_cores: Option<u8>,
|
||||
pub gpu_cores: Option<u8>,
|
||||
}
|
||||
pub use proxy::SystemStatsResponse;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
||||
Reference in New Issue
Block a user