aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/whirl_api/Cargo.toml2
-rw-r--r--crates/whirl_api/src/routes/stats/mod.rs10
-rw-r--r--crates/whirl_prompt/Cargo.toml2
3 files changed, 7 insertions, 7 deletions
diff --git a/crates/whirl_api/Cargo.toml b/crates/whirl_api/Cargo.toml
index 81f76b5..ee42ff7 100644
--- a/crates/whirl_api/Cargo.toml
+++ b/crates/whirl_api/Cargo.toml
@@ -18,7 +18,7 @@ actix-web = { version = "3.3.2", features = ["rustls"] }
actix-cors = "0.5.4"
# Utility
-sysinfo = "0.18.2"
+sysinfo = "0.19.0"
whirl_common = { path = "../whirl_common" }
tokio = { version = "1.7.1", features = ["full"] }
num-traits = "0.2.14"
diff --git a/crates/whirl_api/src/routes/stats/mod.rs b/crates/whirl_api/src/routes/stats/mod.rs
index ed45d0d..c0f8f72 100644
--- a/crates/whirl_api/src/routes/stats/mod.rs
+++ b/crates/whirl_api/src/routes/stats/mod.rs
@@ -17,20 +17,20 @@ pub fn statistics() -> HttpResponse {
let mut sys = System::new_all();
sys.refresh_all();
- let process = sys.get_process(get_current_pid().unwrap()).unwrap();
+ let process = sys.process(get_current_pid().unwrap()).unwrap();
HttpResponse::Ok().json(Statistics {
system: StatisticsSystem {
- os_type: sys.get_name().unwrap(),
- release: sys.get_kernel_version().unwrap(),
+ os_type: sys.name().unwrap(),
+ release: sys.kernel_version().unwrap(),
uptime: whirl_common::system::seconds_to_hrtime(
- usize::try_from(sysinfo::System::new().get_uptime()).unwrap(),
+ usize::try_from(sysinfo::System::new().uptime()).unwrap(),
),
},
process: StatisticsProcess {
// (process.cpu_usage() * 100.0).round() / 100.0
memory_usage: (process.memory() / 1000).to_string(),
- cpu_usage: (process.cpu_usage() / sys.get_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),
},
})
diff --git a/crates/whirl_prompt/Cargo.toml b/crates/whirl_prompt/Cargo.toml
index 13a63fa..48bff89 100644
--- a/crates/whirl_prompt/Cargo.toml
+++ b/crates/whirl_prompt/Cargo.toml
@@ -14,7 +14,7 @@ publish = false
[dependencies]
# Utility
-sysinfo = "0.18.2"
+sysinfo = "0.19.0"
colour = "0.6.0"
# Config