From 7dbb8cd9877b27dcb22e3c03a95c8314c68523a5 Mon Sep 17 00:00:00 2001 From: steve-chavez Date: Tue, 17 Jun 2025 16:38:06 -0500 Subject: [PATCH] nix: better monitoring loadtest report readability --- nix/tools/loadtest.nix | 3 +++ nix/tools/merge_monitor_result.py | 8 ++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/nix/tools/loadtest.nix b/nix/tools/loadtest.nix index 645189abf..5ec25a67c 100644 --- a/nix/tools/loadtest.nix +++ b/nix/tools/loadtest.nix @@ -231,6 +231,9 @@ let echo -e '\n\n## Process monitoring results\n' + echo 'Tracks the memory and CPU usage in 1 second intervals for the duration of the loadtest.' + echo -e 'If a branch finishes its loadtest in less seconds than another branch, it will have blank cells for the missing seconds.\n' + find loadtest -type f -iname '*.csv' \ | sort -nr \ | ${mergeMonitorResults} diff --git a/nix/tools/merge_monitor_result.py b/nix/tools/merge_monitor_result.py index 4e5498030..9fffb8408 100644 --- a/nix/tools/merge_monitor_result.py +++ b/nix/tools/merge_monitor_result.py @@ -9,16 +9,16 @@ merged = None paths = [p.strip() for p in sys.stdin.read().split() if p.strip()] for csv_path in paths: - # pfix is prefix (variable shortened to pass linter) - pfix = os.path.splitext(os.path.basename(csv_path))[0] + # br is branch (variable shortened to pass linter) + br = os.path.splitext(os.path.basename(csv_path))[0] df = pd.read_csv(csv_path) if KEY not in df.columns: sys.exit(f"{csv_path} is missing the {KEY} column") - # add prefix to every metric column - df = df.rename(columns={c: f"{pfix} {c}" for c in df.columns if c != KEY}) + # add branch marker to every metric column + df = df.rename(columns={c: f"{c} [{br}]" for c in df.columns if c != KEY}) # outer join so missing rows appear merged = df if merged is None else merged.merge(df, on=KEY, how="outer")