From 69d19989007b92ce15b6f50e7f0830f3f7ff9145 Mon Sep 17 00:00:00 2001 From: Andrei Neagu Date: Mon, 25 Mar 2024 11:28:13 +0100 Subject: [PATCH] refactor limits --- docker/activity_monitor.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/docker/activity_monitor.py b/docker/activity_monitor.py index fc16f12..1d2736e 100755 --- a/docker/activity_monitor.py +++ b/docker/activity_monitor.py @@ -28,9 +28,9 @@ _KB: Final[int] = 1024 -BUSY_USAGE_THRESHOLD_CPU: Final[float] = 5 # percent in range [0, 100] -BUSY_USAGE_THRESHOLD_DISK_READ: Final[int] = 512 * _KB -BUSY_USAGE_THRESHOLD_DISK_WRITE: Final[int] = 512 * _KB +BUSY_USAGE_THRESHOLD_CPU: Final[float] = 0.5 # percent in range [0, 100] +BUSY_USAGE_THRESHOLD_DISK_READ: Final[int] = 0 +BUSY_USAGE_THRESHOLD_DISK_WRITE: Final[int] = 0 BUSY_USAGE_THRESHOLD_NETWORK_RECEIVED: Final[int] = 1 * _KB BUSY_USAGE_THRESHOLD_NETWORK_SENT: Final[int] = 1 * _KB @@ -251,8 +251,8 @@ def _get_bytes_over_one_second( current: tuple[TimeSeconds, BytesRead, BytesWrite], ) -> tuple[BytesRead, BytesWrite]: interval = current[0] - last[0] - measured_bytes_read_in_interval = current[1] - measured_bytes_write_in_interval = current[2] + measured_bytes_read_in_interval = current[1] - last[1] + measured_bytes_write_in_interval = current[2] - last[2] # bytes_*_1_second[%] = 1[s] * measured_bytes_*_in_interval[%] / interval[s] bytes_read_over_1_second = int(measured_bytes_read_in_interval / interval)