提交 36be1215 编写于 作者: C Captain.B 提交者: BugKing

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

上级 c69ed276
...@@ -30,11 +30,9 @@ ...@@ -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 @@ ...@@ -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>
...@@ -127,57 +153,90 @@ ...@@ -127,57 +153,90 @@
</template> </template>
<script> <script>
export default { export default {
name: "ErrorLog", name: "ErrorLog",
data() { data() {
return { return {
tableData: [], tableData: [],
errorTop5: [], errorSummary: [],
id: '' errorTop1: [],
} errorTop2: [],
}, errorTop3: [],
methods: { errorTop4: [],
initTableData() { errorTop5: [],
this.$get("/performance/report/content/errors/" + this.id).then(res => { id: ''
this.tableData = res.data.data; };
}).catch(() => { },
methods: {
initTableData() {
this.$get("/performance/report/content/errors/" + this.id).then(res => {
this.tableData = res.data.data;
}).catch(() => {
this.tableData = [];
});
this.$get("/performance/report/content/errors_top5/" + this.id).then(res => {
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(() => {
this.errorTop1 = [];
this.errorTop2 = [];
this.errorTop3 = [];
this.errorTop4 = [];
this.errorTop5 = [];
this.errorSummary = [];
});
}
},
watch: {
report: {
handler(val) {
if (!val.status || !val.id) {
return;
}
let status = val.status;
this.id = val.id;
if (status === "Completed" || status === "Running") {
this.initTableData();
} else {
this.tableData = []; this.tableData = [];
}) this.errorTop1 = [];
this.$get("/performance/report/content/errors_top5/" + this.id).then(res => { this.errorTop2 = [];
this.errorTop5 = res.data.data; this.errorTop3 = [];
}).catch(() => { this.errorTop4 = [];
this.errorTop5 = []; this.errorTop5 = [];
}) this.errorSummary = [];
} }
}, },
watch: { deep: true
report: { }
handler(val) { },
if (!val.status || !val.id) { props: ['report']
return; };
}
let status = val.status;
this.id = val.id;
if (status === "Completed" || status === "Running") {
this.initTableData();
} else {
this.tableData = [];
this.errorTop5 = [];
}
},
deep: true
}
},
props: ['report']
}
</script> </script>
<style scoped> <style scoped>
.table-title { .table-title {
font-size: 20px; font-size: 20px;
color: #8492a6; color: #8492a6;
display: block; display: block;
text-align: center; text-align: center;
margin-bottom: 8px; margin-bottom: 8px;
} margin-top: 40px;
}
</style> </style>
...@@ -6,14 +6,15 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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 @@ ...@@ -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>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册