rrd: pack multiple rrd values into th estat list

This commit is contained in:
Dietmar Maurer
2020-05-23 14:03:44 +02:00
parent ba1c249eec
commit a4a3f7ca5e
5 changed files with 139 additions and 27 deletions

View File

@ -20,15 +20,20 @@ use crate::api2::types::*;
},
},
)]
/// Read CPU stats
fn get_cpu_stats(
/// Read node stats
fn get_node_stats(
timeframe: RRDTimeFrameResolution,
cf: RRDMode,
_param: Value,
) -> Result<Value, Error> {
crate::rrd::extract_data("host/cpu", timeframe, cf)
crate::rrd::extract_data_list(
"host",
&["cpu", "iowait", "memtotal", "memused"],
timeframe,
cf,
)
}
pub const ROUTER: Router = Router::new()
.get(&API_METHOD_GET_CPU_STATS);
.get(&API_METHOD_GET_NODE_STATS);