fix(性能测试): 修复性能测试报告的错误请求列表中没有错误请求时表格显示NaN%的问题
修复性能测试报告的错误请求列表中没有错误请求时表格显示NaN%的问题
This commit is contained in:
parent
75db7ff151
commit
60cc4f8ca2
|
@ -108,7 +108,11 @@ export default {
|
||||||
this.sampleRows[sampleName] = index;
|
this.sampleRows[sampleName] = index;
|
||||||
}
|
}
|
||||||
this.tableData.forEach(item => {
|
this.tableData.forEach(item => {
|
||||||
|
if (errorCount === 0) {
|
||||||
|
item.percentOfErrors = '0%';
|
||||||
|
} else {
|
||||||
item.percentOfErrors = (item.error / errorCount * 100).toFixed(2) + '%';
|
item.percentOfErrors = (item.error / errorCount * 100).toFixed(2) + '%';
|
||||||
|
}
|
||||||
item.percentOfSamples = (item.count / allSampleCount * 100).toFixed(2) + '%';
|
item.percentOfSamples = (item.count / allSampleCount * 100).toFixed(2) + '%';
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue