aboutsummaryrefslogtreecommitdiff
path: root/crates/whirl_api/src/routes
diff options
context:
space:
mode:
authorFuwn <[email protected]>2024-06-03 14:57:47 -0700
committerFuwn <[email protected]>2024-06-03 14:57:47 -0700
commita6b766541ae58053ae705e0559d1a1ae8212634b (patch)
treeaeb55206e77679b2f5e1f47fae7f1bda5c6df5b9 /crates/whirl_api/src/routes
parentMerge pull request #153 from Whirlsplash/renovate/actions-checkout-3.x (diff)
downloadwhirl-old.tar.xz
whirl-old.zip
fix: bump rust and update accordinglyold
Diffstat (limited to 'crates/whirl_api/src/routes')
-rw-r--r--crates/whirl_api/src/routes/stats/mod.rs3
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),
},
}),