deps: bump procfs to 0.15.1 (#1038)

This commit is contained in:
Clement Tsang 2023-03-02 17:40:56 -05:00 committed by GitHub
parent f26d598410
commit c2d94900f3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

4
Cargo.lock generated
View File

@ -1350,9 +1350,9 @@ dependencies = [
[[package]]
name = "procfs"
version = "0.14.2"
version = "0.15.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b1de8dacb0873f77e6aefc6d71e044761fcc68060290f5b1089fcdf84626bb69"
checksum = "943ca7f9f29bab5844ecd8fdb3992c5969b6622bb9609b9502fef9b4310e3f1f"
dependencies = [
"bitflags",
"byteorder",

View File

@ -109,7 +109,7 @@ libc = "0.2.124"
[target.'cfg(target_os = "linux")'.dependencies]
heim = { version = "0.1.0-rc.1", features = ["disk", "memory", "net", "sensors"] }
procfs = { version = "0.14.2", default-features = false }
procfs = { version = "0.15.1", default-features = false }
smol = "1.2.5"
[target.'cfg(target_os = "macos")'.dependencies]

View File

@ -163,7 +163,7 @@ fn read_proc(
use_current_cpu_total,
);
let parent_pid = Some(stat.ppid);
let mem_usage_bytes = stat.rss_bytes()?;
let mem_usage_bytes = stat.rss_bytes();
let mem_usage_kb = mem_usage_bytes / 1024;
let mem_usage_percent = mem_usage_kb as f64 / mem_total_kb as f64 * 100.0;