From 778766c3a585ae2f2e1bdc35721f46767e99c68c Mon Sep 17 00:00:00 2001 From: Tyler Gu Date: Thu, 16 Nov 2023 16:06:02 -0600 Subject: [PATCH] Fix Signed-off-by: Tyler Gu --- performance_measurement/measure_performance.py | 10 ++++++---- performance_measurement/rabbitmq_inputs.py | 2 ++ 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/performance_measurement/measure_performance.py b/performance_measurement/measure_performance.py index bcfd9395d..92fc04944 100644 --- a/performance_measurement/measure_performance.py +++ b/performance_measurement/measure_performance.py @@ -108,6 +108,12 @@ def test_normal( gen += 1 +def generate_inputs(testrun_dir: str, input_generator: ChainInputs, config: OperatorConfig): + chain_inputs = input_generator(testrun_dir=testrun_dir, config=config) + os.makedirs(f"{testrun_dir}/inputs", exist_ok=True) + chain_inputs.serialize(f"{testrun_dir}/inputs") + + def main(args): input_generator: ChainInputs = None condition_1_func: ConditionFuncType = None @@ -134,10 +140,6 @@ def main(args): del config["monkey_patch"] config = OperatorConfig(**config) - chain_inputs = input_generator(testrun_dir=args.input_dir, config=config) - os.makedirs(f"{args.workdir_path}/inputs", exist_ok=True) - chain_inputs.serialize(f"{args.workdir_path}/inputs") - # Run the Anvil performance test if "anvil" in args.phase: anvil_workdir = f"{args.workdir_path}/anvil" diff --git a/performance_measurement/rabbitmq_inputs.py b/performance_measurement/rabbitmq_inputs.py index e15b2ad72..07ecf2f18 100644 --- a/performance_measurement/rabbitmq_inputs.py +++ b/performance_measurement/rabbitmq_inputs.py @@ -19,6 +19,7 @@ def serialize(self, output_dir: str): reference_input_dir = os.path.join(output_dir, "reference") os.makedirs(anvil_input_dir, exist_ok=True) os.makedirs(reference_input_dir, exist_ok=True) + print(f"Serializing to {output_dir}") prev_replicas = 3 for input in self.all_inputs: print(f"{input['trial']}") @@ -31,6 +32,7 @@ def serialize(self, output_dir: str): del input["input"]["spec"]["claims"] patch = jsonpatch.JsonPatch.from_diff(previous_input, input["input"]) if patch: + print(patch) with open(os.path.join(anvil_input_dir, f'input-{index:03d}.yaml'), 'w') as f: yaml.dump(input["input"], f) with open(os.path.join(reference_input_dir, f'input-{index:03d}.yaml'), 'w') as f: