From ec2938566d49c344dbc70b8f4c8110f1752b0cd9 Mon Sep 17 00:00:00 2001 From: orzcncn Date: Wed, 23 Oct 2019 08:38:50 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8A=A5=E5=91=8Aduration=E7=BB=9F=E8=AE=A1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- httprunner/report.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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] From 2450ed1e23a97bbc01cf7c08716c3ff3749e7ef8 Mon Sep 17 00:00:00 2001 From: orzcncn Date: Wed, 23 Oct 2019 21:16:18 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=8A=A5=E5=91=8Aduration=E7=BB=9F=E8=AE=A1=E9=94=99=E8=AF=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- httprunner/report.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/httprunner/report.py b/httprunner/report.py index 9a1c3a5d..8245ac22 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