Replace the procfs by libproc

This commit is contained in:
Clément Renault
2024-02-06 18:12:04 +01:00
committed by Louis Dureuil
parent d78ada07b5
commit 02dcaf07db
6 changed files with 100 additions and 90 deletions

View File

@ -188,9 +188,8 @@ fn print_duration(duration: std::time::Duration) -> String {
}
/// Format only the allocated bytes, deallocated bytes and reallocated bytes in GiB, MiB, KiB, Bytes.
fn print_memory(MemoryStats { resident, shared, oom_score }: MemoryStats) -> String {
fn print_memory(MemoryStats { resident }: MemoryStats) -> String {
use byte_unit::Byte;
let rss_bytes = Byte::from_bytes(resident).get_appropriate_unit(true);
let shared_bytes = Byte::from_bytes(shared).get_appropriate_unit(true);
format!("RSS {rss_bytes:.2}, Shared {shared_bytes:.2}, OOM score {oom_score}")
format!("RSS {rss_bytes:.2}")
}