From 1c3bfdb0f9ecc0b0d3f0ac0190b911fa1ae20e8f Mon Sep 17 00:00:00 2001 From: Twan Stok Date: Mon, 13 Mar 2023 03:37:23 +0100 Subject: [PATCH] expanded comment to explain method. --- src/app/data_harvester/memory/sysinfo.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/app/data_harvester/memory/sysinfo.rs b/src/app/data_harvester/memory/sysinfo.rs index 689f220d..c4475022 100644 --- a/src/app/data_harvester/memory/sysinfo.rs +++ b/src/app/data_harvester/memory/sysinfo.rs @@ -37,7 +37,8 @@ pub(crate) fn get_swap_usage(sys: &System) -> Option { }) } -/// Returns cache usage. +/// Returns cache usage. sysinfo has no way to do this directly but it should equal the difference +/// between the available and free memory. On windows, this will always be 0. TODO: hide on windows? pub(crate) fn get_cache_usage(sys: &System) -> Option { let mem_used_in_kib = (sys.available_memory() - sys.free_memory()) / 1024; let mem_total_in_kib = sys.total_memory() / 1024;