diff --git a/client/driver/driver_config.py b/client/driver/driver_config.py index 017c944..8745359 100644 --- a/client/driver/driver_config.py +++ b/client/driver/driver_config.py @@ -93,7 +93,7 @@ DRIVER_HOME = os.path.dirname(os.path.realpath(__file__)) RESULT_DIR = os.path.join(DRIVER_HOME, 'results') # Set this to add user defined metrics -ENABLE_UDM = True +ENABLE_UDM = False # Path to the User Defined Metrics (UDM), only required when ENABLE_UDM is True UDM_DIR = os.path.join(DRIVER_HOME, 'userDefinedMetrics') diff --git a/client/driver/fabfile.py b/client/driver/fabfile.py index 97e181c..5d54e26 100644 --- a/client/driver/fabfile.py +++ b/client/driver/fabfile.py @@ -599,6 +599,12 @@ def clean_logs(): local('rm -f {} {}'.format(dconf.OLTPBENCH_LOG, dconf.CONTROLLER_LOG)) +@task +def clean_oltpbench_results(): + # remove oltpbench result files + local('rm -f {}/results/*'.format(dconf.OLTPBENCH_HOME)) + + @task def loop(i): i = int(i) @@ -642,6 +648,7 @@ def loop(i): # add user defined metrics if dconf.ENABLE_UDM is True: add_udm() + clean_oltpbench_results() # save result result_timestamp = save_dbms_result() @@ -687,7 +694,6 @@ def run_loops(max_iter=10): # reload database periodically if dconf.RELOAD_INTERVAL > 0: - # wait 5 secs after restarting databases time.sleep(15) if i % dconf.RELOAD_INTERVAL == 0: if i == 0 and dump is False: diff --git a/client/driver/userDefinedMetrics/user_defined_metrics.py b/client/driver/userDefinedMetrics/user_defined_metrics.py index 7f2eacc..b691ce7 100644 --- a/client/driver/userDefinedMetrics/user_defined_metrics.py +++ b/client/driver/userDefinedMetrics/user_defined_metrics.py @@ -4,8 +4,9 @@ import copy import argparse import os sys.path.append("../../../") +sys.path.append("../") from server.website.website.types import VarType # pylint: disable=import-error,wrong-import-position,line-too-long # noqa: E402 - +from driver_config import OLTPBENCH_HOME # pylint: disable=import-error,wrong-import-position # noqa: E402 parser = argparse.ArgumentParser() # pylint: disable=invalid-name parser.add_argument("result_dir") @@ -37,7 +38,8 @@ USER_DEINFED_METRICS = { def get_udm(): - with open('../oltpbench.summary', 'r') as f: + summary_path = OLTPBENCH_HOME + '/results/outputfile.summary' + with open(summary_path, 'r') as f: info = json.load(f) metrics = copy.deepcopy(USER_DEINFED_METRICS) if HAS_TARGET_OBJECTIVE is False: