diff --git a/httprunner/report.py b/httprunner/report.py index 15877b4c..9a1c3a5d 100644 --- a/httprunner/report.py +++ b/httprunner/report.py @@ -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]