mirror of
https://github.com/csehviktor/status-monitor.git
synced 2025-08-08 18:06:14 +02:00
finish primitive server logic
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
use serde::Serialize;
|
||||
use serde::{Deserialize, Serialize};
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Metrics {
|
||||
pub system_info: SystemInfo,
|
||||
pub cpu: CPU,
|
||||
@@ -9,7 +9,7 @@ pub struct Metrics {
|
||||
pub network: Network,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct SystemInfo {
|
||||
pub uptime: u64,
|
||||
pub host: Option<String>,
|
||||
@@ -18,16 +18,24 @@ pub struct SystemInfo {
|
||||
pub os_version: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct CPU {
|
||||
pub brand: String,
|
||||
pub usage: f32,
|
||||
pub threads: usize,
|
||||
pub breakdown: CpuBreakdown,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize)]
|
||||
#[derive(Debug, Serialize, Deserialize, Default)]
|
||||
pub struct CpuBreakdown {
|
||||
pub system: f32,
|
||||
pub user: f32,
|
||||
pub idle: f32,
|
||||
pub steal: f32,
|
||||
pub iowait: f32,
|
||||
}
|
||||
|
||||
#[derive(Debug, Serialize, Deserialize)]
|
||||
pub struct Disk {
|
||||
pub used: u64,
|
||||
pub free: u64,
|
||||
pub total: u64,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user