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.
This commit is contained in:
Salamandar 2024-05-20 19:13:55 +02:00 committed by OniriCorpe
parent aaca713790
commit b97296eb77

View file

@ -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() {