diff options
| author | Fuwn <[email protected]> | 2024-06-03 14:57:47 +0000 |
|---|---|---|
| committer | Fuwn <[email protected]> | 2024-06-03 14:57:47 +0000 |
| commit | 3abe7df3fbc12a8df259f48c746f2b9344a5f33c (patch) | |
| tree | efec8803b8b65db8f56fafe884f879921091805a /crates/whirl_api/src/routes/stats | |
| parent | Merge pull request #153 from Whirlsplash/renovate/actions-checkout-3.x (diff) | |
| download | whirl-old.tar.xz whirl-old.zip | |
fix: bump rust and update accordinglyorigin/oldold
Diffstat (limited to 'crates/whirl_api/src/routes/stats')
| -rw-r--r-- | crates/whirl_api/src/routes/stats/mod.rs | 3 |
1 files changed, 1 insertions, 2 deletions
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), }, }), |