mirror of
https://github.com/httprunner/httprunner.git
synced 2026-05-12 19:39:44 +08:00
修复测试报告duration统计错误
This commit is contained in:
@@ -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]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user