clean up driver
This commit is contained in:
parent
b9f9ac1b12
commit
97f49bad07
|
@ -273,6 +273,7 @@ def load_oltpbench():
|
||||||
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
||||||
msg += 'please double check the option in driver_config.py'
|
msg += 'please double check the option in driver_config.py'
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
|
set_oltpbench_config()
|
||||||
cmd = "./oltpbenchmark -b {} -c {} --create=true --load=true".\
|
cmd = "./oltpbenchmark -b {} -c {} --create=true --load=true".\
|
||||||
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG)
|
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG)
|
||||||
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
||||||
|
@ -285,6 +286,7 @@ def run_oltpbench():
|
||||||
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
||||||
msg += 'please double check the option in driver_config.py'
|
msg += 'please double check the option in driver_config.py'
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
|
set_oltpbench_config()
|
||||||
cmd = "./oltpbenchmark -b {} -c {} --execute=true -s 5 -o outputfile".\
|
cmd = "./oltpbenchmark -b {} -c {} --execute=true -s 5 -o outputfile".\
|
||||||
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG)
|
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG)
|
||||||
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
||||||
|
@ -297,6 +299,8 @@ def run_oltpbench_bg():
|
||||||
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
msg = 'oltpbench config {} does not exist, '.format(dconf.OLTPBENCH_CONFIG)
|
||||||
msg += 'please double check the option in driver_config.py'
|
msg += 'please double check the option in driver_config.py'
|
||||||
raise Exception(msg)
|
raise Exception(msg)
|
||||||
|
# set oltpbench config, including db username, password, url
|
||||||
|
set_oltpbench_config()
|
||||||
cmd = "./oltpbenchmark -b {} -c {} --execute=true -s 5 -o outputfile > {} 2>&1 &".\
|
cmd = "./oltpbenchmark -b {} -c {} --execute=true -s 5 -o outputfile > {} 2>&1 &".\
|
||||||
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG, dconf.OLTPBENCH_LOG)
|
format(dconf.OLTPBENCH_BENCH, dconf.OLTPBENCH_CONFIG, dconf.OLTPBENCH_LOG)
|
||||||
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
with lcd(dconf.OLTPBENCH_HOME): # pylint: disable=not-context-manager
|
||||||
|
@ -731,9 +735,6 @@ def loop(i):
|
||||||
p.start()
|
p.start()
|
||||||
LOG.info('Run the controller')
|
LOG.info('Run the controller')
|
||||||
|
|
||||||
# set oltpbench config, including db username, password, url
|
|
||||||
set_oltpbench_config()
|
|
||||||
|
|
||||||
# run oltpbench as a background job
|
# run oltpbench as a background job
|
||||||
while not _ready_to_start_oltpbench():
|
while not _ready_to_start_oltpbench():
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
Loading…
Reference in New Issue