fix(性能测试): 修复性能测试报告的错误请求列表中没有错误请求时表格显示NaN%的问题

修复性能测试报告的错误请求列表中没有错误请求时表格显示NaN%的问题
This commit is contained in:
song-tianyang 2023-12-25 15:57:51 +08:00 committed by 建国
parent 75db7ff151
commit 60cc4f8ca2
1 changed files with 5 additions and 1 deletions

View File

@ -108,7 +108,11 @@ export default {
this.sampleRows[sampleName] = index;
}
this.tableData.forEach(item => {
item.percentOfErrors = (item.error / errorCount * 100).toFixed(2) + '%';
if (errorCount === 0) {
item.percentOfErrors = '0%';
} else {
item.percentOfErrors = (item.error / errorCount * 100).toFixed(2) + '%';
}
item.percentOfSamples = (item.count / allSampleCount * 100).toFixed(2) + '%';
});
} else {