mirror of
https://github.com/valitydev/yandex-tank.git
synced 2024-11-06 10:25:17 +00:00
Change work with tmp dirs
This commit is contained in:
parent
a31849c6c5
commit
14c6c9317d
@ -13,7 +13,6 @@ import tempfile
|
||||
import time
|
||||
import traceback
|
||||
|
||||
# FIXME: 1 remove lock in case of config format error
|
||||
# TODO: 2 add system resources busy check
|
||||
class ConsoleTank:
|
||||
"""
|
||||
|
@ -570,7 +570,6 @@ class PhantomInfoWidget(AbstractInfoWidget, AggregateResultListener):
|
||||
|
||||
self.RPS = second_aggregate_data.overall.RPS
|
||||
self.selfload = second_aggregate_data.overall.selfload
|
||||
self.log.debug("%s %s", second_aggregate_data.time.timetuple(), self.owner.phantom_start_time)
|
||||
self.time_lag = int(time.time() - time.mktime(second_aggregate_data.time.timetuple()))
|
||||
|
||||
|
||||
|
12
tankcore.py
12
tankcore.py
@ -324,11 +324,16 @@ class TankCore:
|
||||
if not self.artifacts_dir:
|
||||
date_str = datetime.datetime.now().strftime("%Y-%m-%d_%H-%M-%S.")
|
||||
self.artifacts_dir = tempfile.mkdtemp("", date_str, self.artifacts_base_dir)
|
||||
elif not os.path.isdir(self.artifacts_dir):
|
||||
if not os.path.isdir(self.artifacts_dir):
|
||||
os.makedirs(self.artifacts_dir)
|
||||
os.chmod(self.artifacts_dir, 0744)
|
||||
|
||||
self.log.info("Artifacts dir: %s", self.artifacts_dir)
|
||||
for filename, keep in self.artifact_files.items():
|
||||
try:
|
||||
self.__collect_file(filename, keep)
|
||||
except Exception, ex:
|
||||
self.log.warn("Failed to collect file %s: %s", filename, ex)
|
||||
|
||||
def plugins_post_process(self, retcode):
|
||||
'''
|
||||
@ -457,6 +462,7 @@ class TankCore:
|
||||
raise RuntimeError("There is lock files")
|
||||
|
||||
self.lock_file = tempfile.mkstemp('.lock', 'lunapark_', self.LOCK_DIR)[1]
|
||||
os.chmod(self.lock_file, 0644)
|
||||
self.config.file = self.lock_file
|
||||
|
||||
|
||||
@ -492,10 +498,6 @@ class TankCore:
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
class ConfigManager:
|
||||
'''
|
||||
Option storage class
|
||||
|
Loading…
Reference in New Issue
Block a user