Skip to content
This repository was archived by the owner on Jan 24, 2024. It is now read-only.
4 changes: 2 additions & 2 deletions analysis_kpis.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ def print_result(self):
suc = False
print("kpi: %s change_tate too bigger !!!!!!!!!!" % kpi_name)
else:
print('kpi:%s' % kpi_name)
log.warn('kpi: %s' % kpi_name)
print('min:%s max:%s mean:%s median:%s std:%s change_rate:%s' %
(self.analysis_result[kpi_name]['min'],
self.analysis_result[kpi_name]['max'],
Expand All @@ -60,4 +60,4 @@ def print_result(self):
self.analysis_result[kpi_name]['std'],
self.analysis_result[kpi_name]['change_rate']))
if not suc:
raise Exception("some kpi's change_tate has bigger then thre")
raise Exception("some kpi's change_rate has bigger then thre")
18 changes: 5 additions & 13 deletions eva.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,6 @@ from analysis_kpis import AnalysisKpiData
$ceroot=config.workspace
os.environ['ceroot'] = config.workspace


def RunCmd(cmd, shellformat=True):
"""run local cmd"""
p = subprocess.Popen(cmd, shell=shellformat, close_fds=True, stdin=subprocess.PIPE, \
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
stdout, stderr = p.communicate()
return (p.returncode, stdout, stderr)


def parse_args():
parser= argparse.ArgumentParser("model benchmark")
parser.add_argument(
Expand All @@ -40,13 +31,14 @@ def get_changed_tasks(args):
if args.task_dir:
tasks = args.task_dir.split()
return tasks
ret, out, err = RunCmd('''cd tasks; git diff HEAD^ HEAD | grep "diff --git" | awk -F' ' {'print $4'}''')
print (ret,out,err)
out = out.strip().decode('utf-8')
cd @(config.baseline_path)
out = $(git diff master | grep "diff --git")
out = out.strip()
for item in out.split('\n'):
task = item.split('/')[1]
task = item.split()[3].split('/')[1]
if task not in tasks:
tasks.append(task)
log.warn("changed tasks: %s" % tasks)
return tasks


Expand Down
10 changes: 5 additions & 5 deletions main.xsh
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,11 @@ def display_fail_info():
log.error('Evaluate [%s] failed!' % paddle_commit)
log.warn('The details:')
for info in infos:
log.info('task:', info['task'])
log.info('passed: ', info['passed'])
log.info('infos', '\n'.join(info['infos']))
log.info('kpis keys', info['kpis-keys'])
log.info('kpis values', info['kpis-values'])
log.warn('task:', info['task'])
log.warn('passed: ', info['passed'])
log.warn('infos', '\n'.join(info['infos']))
log.warn('kpis keys', info['kpis-keys'])
log.warn('kpis values', info['kpis-values'])


def display_success_info():
Expand Down