refactor(性能测试): 报告统计table的宽度修改

This commit is contained in:
Captain.B 2021-05-08 14:11:37 +08:00 committed by 刘瑞斌
parent f2e6767f6d
commit 9d2e1a4d9c
2 changed files with 144 additions and 76 deletions

View File

@ -30,11 +30,9 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<div style="margin-top: 40px;"></div>
<span class="table-title">Top 5 Errors</span> <span class="table-title">Top 5 Errors</span>
<el-table <el-table
:data="errorTop5" :data="errorSummary"
border border
stripe stripe
style="width: 100%" style="width: 100%"
@ -43,83 +41,111 @@
<el-table-column <el-table-column
prop="sample" prop="sample"
label="Sample" label="Sample"
width="200"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="samples" prop="samples"
label="#Samples" label="#Samples"
width="120"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="errorsAllSize" prop="errorsAllSize"
label="All Errors" label="All Errors"
width="100"
> >
</el-table-column> </el-table-column>
</el-table>
<span class="table-title">#1 Error</span>
<el-table
:data="errorTop1"
border
stripe
style="width: 100%"
>
<el-table-column <el-table-column
prop="error1" prop="error1"
label="#1 Error" label="#1 Error"
width="400"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="error1Size" prop="error1Size"
label="#1 Errors Count" label="#1 Errors Count"
width="150"
> >
</el-table-column> </el-table-column>
</el-table>
<span class="table-title">#2 Error</span>
<el-table
:data="errorTop2"
border
stripe
style="width: 100%"
>
<el-table-column <el-table-column
prop="error2" prop="error2"
label="#2 Error" label="#2 Error"
width="400"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="error2Size" prop="error2Size"
label="#2 Errors Count" label="#2 Errors Count"
width="150"
> >
</el-table-column> </el-table-column>
</el-table>
<span class="table-title">#3 Error</span>
<el-table
:data="errorTop3"
border
stripe
style="width: 100%"
>
<el-table-column <el-table-column
prop="error3" prop="error3"
label="#3 Error" label="#3 Error"
width="400"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="error3Size" prop="error3Size"
label="#3 Errors Count" label="#3 Errors Count"
width="150"
> >
</el-table-column> </el-table-column>
</el-table>
<span class="table-title">#4 Error</span>
<el-table
:data="errorTop4"
border
stripe
style="width: 100%"
>
<el-table-column <el-table-column
prop="error4" prop="error4"
label="#4 Error" label="#4 Error"
width="400"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="error4Size" prop="error4Size"
label="#4 Errors Count" label="#4 Errors Count"
width="150"
> >
</el-table-column> </el-table-column>
</el-table>
<span class="table-title">#5 Error</span>
<el-table
:data="errorTop5"
border
stripe
style="width: 100%"
>
<el-table-column <el-table-column
prop="error5" prop="error5"
label="#5 Error" label="#5 Error"
width="400"
> >
</el-table-column> </el-table-column>
<el-table-column <el-table-column
prop="error5Size" prop="error5Size"
label="#5 Errors Count" label="#5 Errors Count"
width="150"
> >
</el-table-column> </el-table-column>
</el-table> </el-table>
@ -132,9 +158,14 @@
data() { data() {
return { return {
tableData: [], tableData: [],
errorSummary: [],
errorTop1: [],
errorTop2: [],
errorTop3: [],
errorTop4: [],
errorTop5: [], errorTop5: [],
id: '' id: ''
} };
}, },
methods: { methods: {
initTableData() { initTableData() {
@ -142,12 +173,34 @@
this.tableData = res.data.data; this.tableData = res.data.data;
}).catch(() => { }).catch(() => {
this.tableData = []; this.tableData = [];
}) });
this.$get("/performance/report/content/errors_top5/" + this.id).then(res => { this.$get("/performance/report/content/errors_top5/" + this.id).then(res => {
this.errorTop5 = res.data.data; this.errorTop1 = res.data.data.map(e => {
return {error1: e.error1, error1Size: e.error1Size};
});
this.errorTop2 = res.data.data.map(e => {
return {error2: e.error2, error2Size: e.error2Size};
});
this.errorTop3 = res.data.data.map(e => {
return {error3: e.error3, error3Size: e.error3Size};
});
this.errorTop4 = res.data.data.map(e => {
return {error4: e.error4, error4Size: e.error4Size};
});
this.errorTop5 = res.data.data.map(e => {
return {error5: e.error5, error5Size: e.error5Size};
});
this.errorSummary = res.data.data.map(e => {
return {sample: e.sample, samples: e.samples, errorsAllSize: e.errorsAllSize};
});
}).catch(() => { }).catch(() => {
this.errorTop1 = [];
this.errorTop2 = [];
this.errorTop3 = [];
this.errorTop4 = [];
this.errorTop5 = []; this.errorTop5 = [];
}) this.errorSummary = [];
});
} }
}, },
watch: { watch: {
@ -162,14 +215,19 @@
this.initTableData(); this.initTableData();
} else { } else {
this.tableData = []; this.tableData = [];
this.errorTop1 = [];
this.errorTop2 = [];
this.errorTop3 = [];
this.errorTop4 = [];
this.errorTop5 = []; this.errorTop5 = [];
this.errorSummary = [];
} }
}, },
deep: true deep: true
} }
}, },
props: ['report'] props: ['report']
} };
</script> </script>
<style scoped> <style scoped>
@ -179,5 +237,6 @@
display: block; display: block;
text-align: center; text-align: center;
margin-bottom: 8px; margin-bottom: 8px;
margin-top: 40px;
} }
</style> </style>

View File

@ -6,14 +6,15 @@
border border
style="width: 100%" style="width: 100%"
> >
<el-table-column label="Requests" fixed width="450" align="center"> <el-table-column label="Requests" fixed min-width="150" align="center">
<el-table-column <el-table-column
prop="label" prop="label"
label="Label" label="Label"
width="450"> min-width="150">
<template v-slot:header="{column}"> <template v-slot:header="{column}">
<span>Label</span> <span>Label</span>
<i class="el-icon-search" style="margin-left: 8px;cursor: pointer;font-weight: bold;" @click="click(column)"></i> <i class="el-icon-search" style="margin-left: 8px;cursor: pointer;font-weight: bold;"
@click="click(column)"></i>
<el-input v-model="searchLabel" <el-input v-model="searchLabel"
placeholder="请输入 Label 搜索" placeholder="请输入 Label 搜索"
size="mini" size="mini"
@ -39,6 +40,7 @@
prop="fail" prop="fail"
label="FAIL" label="FAIL"
align="center" align="center"
min-width="60"
/> />
<el-table-column <el-table-column
@ -51,39 +53,46 @@
<el-table-column label="Response Times(ms)" align="center"> <el-table-column label="Response Times(ms)" align="center">
<el-table-column <el-table-column
prop="average" prop="average"
label="Average" label="Avg"
min-width="60"
/> />
<el-table-column <el-table-column
prop="min" prop="min"
label="Min" label="Min"
min-width="60"
/> />
<el-table-column <el-table-column
prop="max" prop="max"
label="Max" label="Max"
min-width="60"
/> />
<el-table-column <el-table-column
prop="median" prop="median"
label="Median" label="Med"
min-width="60"
/> />
<el-table-column <el-table-column
prop="tp90" prop="tp90"
label="90% line" label="90%"
min-width="60"
/> />
<el-table-column <el-table-column
prop="tp95" prop="tp95"
label="95% line" label="95%"
min-width="60"
/> />
<el-table-column <el-table-column
prop="tp99" prop="tp99"
label="99% line" label="99%"
min-width="60"
/> />
</el-table-column> </el-table-column>
<el-table-column label="Throughput"> <el-table-column label="Throughput">
<el-table-column <el-table-column
prop="transactions" prop="transactions"
label="Transactions/s" label="Trans/s"
width="150" width="100"
/> />
</el-table-column> </el-table-column>
@ -92,13 +101,13 @@
prop="received" prop="received"
label="Received" label="Received"
align="center" align="center"
width="150" width="100"
/> />
<el-table-column <el-table-column
prop="sent" prop="sent"
label="Sent" label="Sent"
align="center" align="center"
width="150" width="100"
/> />
</el-table-column> </el-table-column>