From 3f0ceafd0beb2e70b0aa03723e72f4e6f56b1d80 Mon Sep 17 00:00:00 2001 From: Ying Chun Guo Date: Thu, 19 Sep 2024 14:33:11 +0800 Subject: [PATCH] add bench-target as the prefix of output folder (#133) Signed-off-by: Yingchun Guo --- evals/benchmark/stresscli/commands/load_test.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/evals/benchmark/stresscli/commands/load_test.py b/evals/benchmark/stresscli/commands/load_test.py index fba1c5ee..8895e5ab 100644 --- a/evals/benchmark/stresscli/commands/load_test.py +++ b/evals/benchmark/stresscli/commands/load_test.py @@ -46,16 +46,17 @@ def locust_runtests(kubeconfig, profile): with open(profile, "r") as file: profile_data = yaml.safe_load(file) + global_settings = profile_data["profile"]["global-settings"] + runs = profile_data["profile"]["runs"] + # create test log folder hostpath = profile_data["profile"]["storage"]["hostpath"] timestamp = datetime.now().strftime("%Y%m%d_%H%M%S") - base_folder = os.path.join(hostpath, f"{timestamp}") + testtarget = global_settings.get("bench-target", locust_defaults["bench-target"]) + base_folder = os.path.join(hostpath, f"{testtarget}_{timestamp}") os.makedirs(base_folder, exist_ok=True) # Extract storage path and run details from profile - global_settings = profile_data["profile"]["global-settings"] - runs = profile_data["profile"]["runs"] - index = 1 for run in runs: print(f"===Starting test: {run['name']}")