From 57c9480ef8645f44fc7372f864c262b52f151c0f Mon Sep 17 00:00:00 2001 From: Renovate Bot Date: Tue, 29 Jun 2021 13:50:38 +0000 Subject: fix(deps): update rust crate sysinfo to 0.19.0 --- crates/whirl_api/Cargo.toml | 2 +- crates/whirl_prompt/Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 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_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 -- cgit v1.2.3 From 34c4160f9c1b773f3625b65b9f76f3a365639ead Mon Sep 17 00:00:00 2001 From: Fuwn Date: Thu, 1 Jul 2021 01:17:21 +0000 Subject: fix(whirl_api): update sysinfo method calls for `0.19.0` --- crates/whirl_api/src/routes/stats/mod.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) 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), }, }) -- cgit v1.2.3