From 72f5d4692a4fffc48aeafce1a13739ac6536ffcd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Vonheiden?= <bjoern.vonheiden@hotmail.de> Date: Thu, 17 Dec 2020 14:29:13 +0100 Subject: [PATCH] Continue benchmark in case of analysis failure. The lag analysis and trend slope computer may fail to various reasons. But the benchmark should continoue, because this may be only temporary errors. --- execution/run_uc.py | 10 ++++++++-- .../subexperiment_evaluator.py | 12 +++++++++--- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/execution/run_uc.py b/execution/run_uc.py index 56d6d0fcf..e1db5f509 100644 --- a/execution/run_uc.py +++ b/execution/run_uc.py @@ -282,8 +282,14 @@ 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: + print('Evaluation function failed') + logging.exception('Evaluation function failed') + return diff --git a/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py b/execution/strategies/subexperiment_evaluation/subexperiment_evaluator.py index 4e46d2d6c..870ec0cd7 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,13 @@ 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: + print('Computing trend slope failed.') + logging.exception('Computing trend slope failed.') + return 0 + print(f"Trend Slope: {trend_slope}") success = 0 if trend_slope > THRESHOLD else 1 -- GitLab