diff --git a/backend/src/main/java/io/metersphere/report/GenerateReport.java b/backend/src/main/java/io/metersphere/report/GenerateReport.java index 9cd66713ab..7d4bb44ec3 100644 --- a/backend/src/main/java/io/metersphere/report/GenerateReport.java +++ b/backend/src/main/java/io/metersphere/report/GenerateReport.java @@ -73,6 +73,8 @@ public class GenerateReport { Map errorDataMap = ResultDataParse.getSummryDataMap(jtlString, new StatisticsSummaryConsumer()); List statisticsList = ResultDataParse.summaryMapParsing(errorDataMap, Statistics.class); Optional error = statisticsList.stream().map(item -> Double.parseDouble(item.getError())).reduce(Double::sum); + double avgTp90 = statisticsList.stream().map(item -> Double.parseDouble(item.getTp90())).mapToDouble(Double::doubleValue).average().orElse(0); + double avgBandwidth = statisticsList.stream().map(item -> Double.parseDouble(item.getReceived())).mapToDouble(Double::doubleValue).average().orElse(0); Map responseDataMap = ResultDataParse.getGraphDataMap(jtlString, new ResponseTimeOverTimeGraphConsumer()); List responseDataList = ResultDataParse.graphMapParsing(responseDataMap, "response"); @@ -85,10 +87,8 @@ public class GenerateReport { testOverview.setAvgThroughput(decimalFormat.format(hits)); testOverview.setErrors(decimalFormat.format(error.get())); testOverview.setAvgResponseTime(decimalFormat.format(responseTime / 1000)); - - // todo - testOverview.setResponseTime90("0"); - testOverview.setAvgBandwidth("0"); + testOverview.setResponseTime90(decimalFormat.format(avgTp90 / 1000)); + testOverview.setAvgBandwidth(decimalFormat.format(avgBandwidth)); return testOverview; } diff --git a/backend/src/main/java/io/metersphere/report/base/SummaryData.java b/backend/src/main/java/io/metersphere/report/base/SummaryData.java deleted file mode 100644 index ccd8958d83..0000000000 --- a/backend/src/main/java/io/metersphere/report/base/SummaryData.java +++ /dev/null @@ -1,16 +0,0 @@ -package io.metersphere.report.base; - -import java.util.List; - -public class SummaryData { - - private List result; - - public List getResult() { - return result; - } - - public void setResult(List result) { - this.result = result; - } -} diff --git a/frontend/src/business/components/performance/report/components/RequestStatistics.vue b/frontend/src/business/components/performance/report/components/RequestStatistics.vue index 48a4d0f7aa..ec51bb9e81 100644 --- a/frontend/src/business/components/performance/report/components/RequestStatistics.vue +++ b/frontend/src/business/components/performance/report/components/RequestStatistics.vue @@ -5,7 +5,6 @@ stripe border style="width: 100%" - show-summary :default-sort = "{prop: 'samples', order: 'descending'}" > @@ -95,7 +94,7 @@ name: "RequestStatistics", data() { return { - tableData: [{},{},{},{},{}] + tableData: [] } }, methods: {