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 @@