修复测试报告duration统计错误

This commit is contained in:
orzcncn
2019-10-23 08:38:50 +08:00
parent b3077f1e79
commit b5299b1a3c

View File

@@ -62,8 +62,8 @@ def get_summary(result):
- summary["stat"]["unexpectedSuccesses"]
summary["time"] = {
'start_at': result.start_at,
'duration': result.duration
'start_at': result.start_at
# 'duration': result.duration
}
summary["records"] = result.records
@@ -82,8 +82,9 @@ def aggregate_stat(origin_stat, new_stat):
if key not in origin_stat:
origin_stat[key] = new_stat[key]
elif key == "start_at":
# start datetime
# start datetime , duration=current_time - min(stat_at)
origin_stat[key] = min(origin_stat[key], new_stat[key])
origin_stat["duration"] = time.time() - origin_stat[key]
else:
origin_stat[key] += new_stat[key]