Spaces:
Sleeping
Sleeping
| use serde::Serialize; | |
| use super::ApiStatus; | |
| pub struct HealthCheckResponse { | |
| pub status: ApiStatus, | |
| pub version: &'static str, | |
| pub uptime: i64, | |
| pub stats: Option<SystemStats>, | |
| pub models: Vec<&'static str>, | |
| pub endpoints: Vec<&'static str>, | |
| } | |
| pub struct SystemStats { | |
| pub started: String, | |
| pub total_requests: u64, | |
| pub active_requests: u64, | |
| pub system: SystemInfo, | |
| } | |
| pub struct SystemInfo { | |
| pub memory: MemoryInfo, | |
| pub cpu: CpuInfo, | |
| } | |
| pub struct MemoryInfo { | |
| pub rss: u64, // 物理内存使用量(字节) | |
| } | |
| pub struct CpuInfo { | |
| pub usage: f32, // CPU 使用率(百分比) | |
| } | |