feat(性能测试): 测试报告支持自定义图表,多坐标轴,取值修改

This commit is contained in:
Captain.B 2021-06-09 09:54:18 +08:00 committed by 刘瑞斌
parent c91bfd84d2
commit 207729e698
1 changed files with 9 additions and 1 deletions

View File

@ -284,9 +284,17 @@ export default {
let allData = [];
let checkAllOption = checkList.indexOf('ALL') > -1;
if (checkAllOption) {
let avgOpt = [
'ResponseTimeChart',
'ResponseTimePercentilesChart',
'LatencyChart',
];
let result = groupBy(data, 'xAxis');
for (const xAxis in result) {
let yAxis = result[xAxis].map(a => a.yAxis).reduce((a, b) => a + b, 0) / result[xAxis].length;
let yAxis = result[xAxis].map(a => a.yAxis).reduce((a, b) => a + b, 0);
if (avgOpt.indexOf(reportKey) > -1) {
yAxis = yAxis / result[xAxis].length;
}
allData.push({
groupName: 'ALL',
xAxis: xAxis,