diff --git a/execution/run_uc.py b/execution/run_uc.py index 56d6d0fcf4f2f6edd49c6692e6e9de0bbbfefb47..a0fcdbb6d57e5dc67d18e69b7d07fcdbfa809307 100644 --- a/execution/run_uc.py +++ b/execution/run_uc.py @@ -282,8 +282,16 @@ def run_evaluation(exp_id, uc_id, dim_value, instances, execution_minutes, prome :param int execution_minutes: How long the use case where executed. """ print('Run evaluation function') - lag_analysis.main(exp_id, f'uc{uc_id}', dim_value, instances, - execution_minutes, prometheus_base_url, result_path) + try: + lag_analysis.main(exp_id, f'uc{uc_id}', dim_value, instances, + execution_minutes, prometheus_base_url, + result_path) + except Exception as e: + err_msg = 'Evaluation function failed' + print(err_msg) + logging.exception(err_msg) + print('Benchmark execution continues') + return diff --git a/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py b/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py index 4e46d2d6ccabb601d9df373a540d23e73d60be28..442a7999cc0c50257f27271e3c41e6c85c0cecee 100644 --- a/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py +++ b/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py @@ -1,7 +1,7 @@ +import lib.trend_slope_computer as trend_slope_computer +import logging import os import sys -import os -import lib.trend_slope_computer as trend_slope_computer THRESHOLD = 2000 WARMUP_SEC = 60 @@ -10,7 +10,15 @@ def execute(config): cwd = f'{os.getcwd()}/{config.result_path}' file = f"exp{config.exp_id}_uc{config.use_case}_{config.dim_value}_{config.replicas}_totallag.csv" - trend_slope = trend_slope_computer.compute(cwd, file, WARMUP_SEC, THRESHOLD) + try: + trend_slope = trend_slope_computer.compute(cwd, file, WARMUP_SEC, THRESHOLD) + except Exception as e: + err_msg = 'Computing trend slope failed' + print(err_msg) + logging.exception(err_msg) + print('Mark this subexperiment as not successful and continue benchmark') + return 0 + print(f"Trend Slope: {trend_slope}") success = 0 if trend_slope > THRESHOLD else 1