1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
use serde::{Deserialize, Serialize};
use tokio_pg_mapper_derive::PostgresMapper;
extern crate chrono;
#[derive(Deserialize, PostgresMapper, Serialize, Clone, Debug)]
#[pg_mapper(table = "stats")]
pub struct Stats {
pub loadavg: String,
pub cpu_usage: String,
pub memory_usage: String,
// pub current_system_time: NaiveDateTime,
}
#[derive(Serialize, Deserialize)]
pub struct StatsResponse {
pub result: bool,
pub data: Stats,
}