devin15/cursor2api-rust
0
1use serde::Serialize;2 3use super::ApiStatus;4 5#[derive(Serialize)]6pub struct HealthCheckResponse {7 pub status: ApiStatus,8 pub version: &'static str,9 pub uptime: i64,10 #[serde(skip_serializing_if = "Option::is_none")]11 pub stats: Option<SystemStats>,12 pub models: Vec<&'static str>,13 pub endpoints: Vec<&'static str>,14}15 16#[derive(Serialize)]17pub struct SystemStats {18 pub started: String,19 pub total_requests: u64,20 pub active_requests: u64,21 pub system: SystemInfo,22}23 24#[derive(Serialize)]25pub struct SystemInfo {26 pub memory: MemoryInfo,27 pub cpu: CpuInfo,28}29 30#[derive(Serialize)]31pub struct MemoryInfo {32 pub rss: u64, // 物理内存使用量(字节)33}34 35#[derive(Serialize)]36pub struct CpuInfo {37 pub usage: f32, // CPU 使用率(百分比)38}39 