提交 8ac80886 编写于 作者: S shiziyuan9527

报告-测试概览

上级 3484e936
......@@ -73,6 +73,8 @@ public class GenerateReport {
Map<String, Object> errorDataMap = ResultDataParse.getSummryDataMap(jtlString, new StatisticsSummaryConsumer());
List<Statistics> statisticsList = ResultDataParse.summaryMapParsing(errorDataMap, Statistics.class);
Optional<Double> 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<String, Object> responseDataMap = ResultDataParse.getGraphDataMap(jtlString, new ResponseTimeOverTimeGraphConsumer());
List<ChartsData> 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;
}
......
package io.metersphere.report.base;
import java.util.List;
public class SummaryData {
private List<Object> result;
public List<Object> getResult() {
return result;
}
public void setResult(List<Object> result) {
this.result = result;
}
}
......@@ -5,7 +5,6 @@
stripe
border
style="width: 100%"
show-summary
:default-sort = "{prop: 'samples', order: 'descending'}"
>
<el-table-column label="Requests" fixed width="450" align="center">
......@@ -95,7 +94,7 @@
name: "RequestStatistics",
data() {
return {
tableData: [{},{},{},{},{}]
tableData: []
}
},
methods: {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册