From 5a76825c57254d70155270223fceb979bba74446 Mon Sep 17 00:00:00 2001 From: Shivansh Katiyar Date: Thu, 25 Jun 2026 17:42:52 +0530 Subject: [PATCH] fix(hogs): correct IO disk space measurement formula (#1402) The IO hog scenario reported negative disk space values because: 1. disk_space from get_node_resources_info() returns availableBytes (free space), not used space 2. The formula subtracted from node_resources_end (misleadingly named, actually measured 3s after pod deploy) instead of node_resources_start When the IO hog writes data, available space decreases. The original formula (avg - end) produced negative values. The correct formula is (start - avg) which measures how much available space was consumed. Tested on AKS (2-node cluster) with io-write-bytes=512m: - Before: -512.24 MB, -495.16 MB, -23.72 MB (5/5 negative) - After: +512.38 MB, +512.23 MB, +500.48 MB (3/3 correct) Signed-off-by: Shiva Signed-off-by: SK8-infi --- krkn/scenario_plugins/hogs/hogs_scenario_plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/krkn/scenario_plugins/hogs/hogs_scenario_plugin.py b/krkn/scenario_plugins/hogs/hogs_scenario_plugin.py index a6134a09..10caaa52 100644 --- a/krkn/scenario_plugins/hogs/hogs_scenario_plugin.py +++ b/krkn/scenario_plugins/hogs/hogs_scenario_plugin.py @@ -146,7 +146,7 @@ class HogsScenarioPlugin(AbstractScenarioPlugin): f"{avg_node_resources.memory / node_resources_start.memory * 100} %") if config.type == HogType.io: logging.info(f"[{node}] detected disk space allocated: " - f"{(avg_node_resources.disk_space - node_resources_end.disk_space) / 1024 / 1024} MB") + f"{(node_resources_start.disk_space - avg_node_resources.disk_space) / 1024 / 1024} MB") except Exception as e: exception_queue.put(e)