diff options
| author | Fuwn <[email protected]> | 2021-07-01 02:22:13 +0000 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-07-01 02:22:13 +0000 |
| commit | 011dfa793c92ee62d5ad8ef8bc2f49b9bde585b6 (patch) | |
| tree | f443873450264502fa2c6a17bcd4fad37a7a7d53 | |
| parent | Merge pull request #51 from Whirlsplash/renovate/husky-7.x (diff) | |
| parent | fix(whirl_api): update sysinfo method calls for `0.19.0` (diff) | |
| download | whirl-011dfa793c92ee62d5ad8ef8bc2f49b9bde585b6.tar.xz whirl-011dfa793c92ee62d5ad8ef8bc2f49b9bde585b6.zip | |
Merge pull request #50 from Whirlsplash/renovate/sysinfo-0.x
fix(deps): update rust crate sysinfo to 0.19.0
| -rw-r--r-- | crates/whirl_api/Cargo.toml | 2 | ||||
| -rw-r--r-- | crates/whirl_api/src/routes/stats/mod.rs | 10 | ||||
| -rw-r--r-- | crates/whirl_prompt/Cargo.toml | 2 |
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 |