From b97296eb77a33d31aaf0322bfda3b245337e85b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?F=C3=A9lix=20Pi=C3=A9dallu?= Date: Mon, 20 May 2024 19:13:55 +0200 Subject: [PATCH] Run resource metrics inside container. This will provide a real RAM metric of the container, and not of the full system. For disk usage that won't change anything. --- lib/common.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/common.sh b/lib/common.sh index 1c7e378..a143833 100644 --- a/lib/common.sh +++ b/lib/common.sh @@ -226,11 +226,11 @@ stop_timer () { # is done via a shared memory. get_ram_usage() { - free -m | grep Mem | awk '{print $3}' + RUN_INSIDE_LXC free -m | grep Mem | awk '{print $3}' } get_disk_usage() { - LANG= df --output="used" --total -k -l | tail -n 1 + RUN_INSIDE_LXC df --output="used" --total -k -l | tail -n 1 } metrics_background_thread() {