From 16f16ab89d228765ef53d4378fd0e264c2f81a26 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Tue, 24 Mar 2020 16:07:52 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E8=AF=B7=E6=B1=82=E7=BB=9F?= =?UTF-8?q?=E8=AE=A1=E8=A1=A8=E6=A0=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/report/JtlResolver.java | 2 +- .../report/base/RequestStatistics.java | 6 +- .../src/test/java/io/metersphere/JtlTest.java | 4 +- .../report/components/RequestStatistics.vue | 121 +++++++++--------- 4 files changed, 64 insertions(+), 69 deletions(-) diff --git a/backend/src/main/java/io/metersphere/report/JtlResolver.java b/backend/src/main/java/io/metersphere/report/JtlResolver.java index 05706d1588..c49e731737 100644 --- a/backend/src/main/java/io/metersphere/report/JtlResolver.java +++ b/backend/src/main/java/io/metersphere/report/JtlResolver.java @@ -84,7 +84,7 @@ public class JtlResolver { RequestStatistics requestStatistics = new RequestStatistics(); requestStatistics.setRequestLabel(label); - requestStatistics.setSamples(index+""); + requestStatistics.setSamples(index); DecimalFormat df = new DecimalFormat("0.00"); String s = df.format((float)sumElapsed/index); requestStatistics.setAverage(s+""); diff --git a/backend/src/main/java/io/metersphere/report/base/RequestStatistics.java b/backend/src/main/java/io/metersphere/report/base/RequestStatistics.java index 6be60c2ea0..71bb7ed9da 100644 --- a/backend/src/main/java/io/metersphere/report/base/RequestStatistics.java +++ b/backend/src/main/java/io/metersphere/report/base/RequestStatistics.java @@ -6,7 +6,7 @@ public class RequestStatistics { private String requestLabel; /**压测请求数*/ - private String samples; + private Integer samples; /**平均响应时间*/ private String average; @@ -43,11 +43,11 @@ public class RequestStatistics { this.requestLabel = requestLabel; } - public String getSamples() { + public Integer getSamples() { return samples; } - public void setSamples(String samples) { + public void setSamples(Integer samples) { this.samples = samples; } diff --git a/backend/src/test/java/io/metersphere/JtlTest.java b/backend/src/test/java/io/metersphere/JtlTest.java index 7d21dbea3a..1a8cfdacde 100644 --- a/backend/src/test/java/io/metersphere/JtlTest.java +++ b/backend/src/test/java/io/metersphere/JtlTest.java @@ -255,8 +255,8 @@ public class JtlTest { RequestStatistics sceneResult = new RequestStatistics(); sceneResult.setRequestLabel(label); - sceneResult.setSamples(index+""); - sceneResult.setAverage(sumElapsed/index+""); + sceneResult.setSamples(index); +// sceneResult.setAverage(sumElapsed/index); sceneResult.setTp90(elapsedList.get(tp90)+""); sceneResult.setTp95(elapsedList.get(tp95)+""); sceneResult.setTp99(elapsedList.get(tp99)+""); diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index c2c266d208..926fb7984e 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -2,78 +2,73 @@
- + + - + + + + + - - - - - - - - - - - - - + + + + + + + + + + + + + + + - - - + align="center" + width="200" + />