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 <shiva@users.noreply.github.com>
Signed-off-by: SK8-infi <shivansh.katiyar1712@gmail.com>
This commit is contained in:
Shivansh Katiyar
2026-06-25 17:42:52 +05:30
committed by GitHub
parent 03416ddbb6
commit 5a76825c57
@@ -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)