diff options
Diffstat (limited to 'crates/whirl_api/src')
| -rw-r--r-- | crates/whirl_api/src/lib.rs | 8 | ||||
| -rw-r--r-- | crates/whirl_api/src/routes/stats/mod.rs | 3 |
2 files changed, 2 insertions, 9 deletions
diff --git a/crates/whirl_api/src/lib.rs b/crates/whirl_api/src/lib.rs index efbec1a..9051f4c 100644 --- a/crates/whirl_api/src/lib.rs +++ b/crates/whirl_api/src/lib.rs @@ -3,13 +3,7 @@ //! The API, for external interaction. -#![feature( - type_ascription, - hash_set_entry, - type_name_of_val, - decl_macro, - proc_macro_hygiene -)] +#![feature(type_ascription, hash_set_entry, decl_macro, proc_macro_hygiene)] #![deny( warnings, nonstandard_style, diff --git a/crates/whirl_api/src/routes/stats/mod.rs b/crates/whirl_api/src/routes/stats/mod.rs index 595b441..05b9bc7 100644 --- a/crates/whirl_api/src/routes/stats/mod.rs +++ b/crates/whirl_api/src/routes/stats/mod.rs @@ -6,7 +6,6 @@ pub mod structures; use std::convert::TryFrom; use axum::response; -use num_traits::cast::AsPrimitive; use sysinfo::{get_current_pid, ProcessExt, System, SystemExt}; use crate::routes::stats::structures::{Statistics, StatisticsProcess, StatisticsSystem}; @@ -31,7 +30,7 @@ pub async fn statistics() -> impl response::IntoResponse { process: StatisticsProcess { // (process.cpu_usage() * 100.0).round() / 100.0 memory_usage: (process.memory() / 1000).to_string(), - cpu_usage: (process.cpu_usage() / sys.processors().len().as_(): f32).to_string(), + cpu_usage: (process.cpu_usage() / sys.processors().len() as f32).to_string(), // uptime: seconds_to_hrtime((sys.get_uptime() - process.start_time()) as usize), }, }), |