Add log files
Store a debug log in ./log/ to help the user determine any possible issues that might popup. The stdout (info) might not provide enough information +Added Logic for Rally Change-Id: I9ca1f42c061ae912fde9af414ada0d328615f458
This commit is contained in:
12
lib/Rally.py
12
lib/Rally.py
@@ -1,6 +1,7 @@
|
||||
from Connmon import Connmon
|
||||
from Pbench import Pbench
|
||||
from Tools import Tools
|
||||
import os
|
||||
import datetime
|
||||
import glob
|
||||
import logging
|
||||
@@ -39,6 +40,16 @@ class Rally:
|
||||
task_args, test_name)
|
||||
self.tools.run_cmd(cmd)
|
||||
|
||||
def workload_logger(self,result_dir) :
|
||||
base = result_dir.split('/')
|
||||
if not os.path.isfile("{}/{}/browbeat-rally-run.log".format(base[0],base[1])) :
|
||||
file = logging.FileHandler("{}/{}/browbeat-rally-run.log".format(base[0],base[1]))
|
||||
file.setLevel(logging.DEBUG)
|
||||
formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)5s - %(message)s')
|
||||
file.setFormatter(formatter)
|
||||
self.logger.addHandler(file)
|
||||
return None
|
||||
|
||||
def get_task_id(self, test_name):
|
||||
cmd = "grep \"rally task results\" {}.log | awk '{{print $4}}'".format(test_name)
|
||||
return self.tools.run_cmd(cmd)
|
||||
@@ -82,6 +93,7 @@ class Rally:
|
||||
self.config['browbeat']['results'], time_stamp, benchmark,
|
||||
scenario)
|
||||
self.logger.debug("Created result directory: {}".format(result_dir))
|
||||
self.workload_logger(result_dir)
|
||||
|
||||
# Override concurrency/times
|
||||
if 'concurrency' in scenario_args:
|
||||
|
||||
Reference in New Issue
Block a user