refactor(性能测试): 调整监控图表,增加单位

This commit is contained in:
shiziyuan9527 2021-04-15 11:09:36 +08:00 committed by 刘瑞斌
parent 847d7a57a5
commit 3d2bb18b8c
2 changed files with 16 additions and 13 deletions

View File

@ -9,7 +9,7 @@ public class MetricQuery {
return new HashMap<String, String>(16) {{
// 指标名:promQL
put("cpu", "100 - (avg by (instance) (irate(node_cpu_seconds_total{instance='%1$s', mode='idle'}[1m])) * 100)");
put("disk", "100 - node_filesystem_free_bytes{instance='%1$s',fstype!~'rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs|udev|none|devpts|sysfs|debugfs|fuse.*'} / node_filesystem_size_bytes{instance='%1$s',fstype!~'rootfs|selinuxfs|autofs|rpc_pipefs|tmpfs|udev|none|devpts|sysfs|debugfs|fuse.*'} * 100");
put("disk", "100 - node_filesystem_free_bytes{instance='%1$s'} / node_filesystem_size_bytes{instance='%1$s'} * 100");
put("memory", "(node_memory_MemTotal_bytes{instance='%1$s'} - node_memory_MemFree_bytes{instance='%1$s'}) / node_memory_MemTotal_bytes{instance='%1$s'} * 100");
put("netIn", "sum by (instance) (irate(node_network_receive_bytes_total{instance='%1$s',device!~'bond.*?|lo'}[1m])/128)");
put("netOut", "sum by (instance) (irate(node_network_transmit_bytes_total{instance='%1$s',device!~'bond.*?|lo'}[1m])/128)");

View File

@ -3,25 +3,23 @@
<el-tabs type="border-card" :stretch="true">
<el-tab-pane v-for="(item,index) in instances" :key="index" :label="item" class="logging-content">
<el-row>
<el-col :span="10" :offset="2">
<el-col :span="8">
<ms-chart ref="chart1" :options="getCpuOption(item)" :autoresize="true"></ms-chart>
</el-col>
<el-col :span="10" :offset="2">
<el-col :span="8">
<ms-chart ref="chart2" :options="getMemoryOption(item)" :autoresize="true"></ms-chart>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="2">
<el-col :span="8">
<ms-chart ref="chart3" :options="getDiskOption(item)" :autoresize="true"></ms-chart>
</el-col>
<el-col :span="10" :offset="2">
<ms-chart ref="chart4" :options="getNetInOption(item)" :autoresize="true"></ms-chart>
</el-col>
</el-row>
<el-row>
<el-col :span="10" :offset="2">
<el-col :span="8">
<ms-chart ref="chart3" :options="getNetOutOption(item)" :autoresize="true"></ms-chart>
</el-col>
<el-col :span="8">
<ms-chart ref="chart4" :options="getNetInOption(item)" :autoresize="true"></ms-chart>
</el-col>
</el-row>
</el-tab-pane>
</el-tabs>
@ -86,6 +84,7 @@ export default {
data: xAxis
},
yAxis: {
name: '使用率(%)',
type: 'value'
},
series: [{
@ -120,6 +119,7 @@ export default {
data: xAxis
},
yAxis: {
name: '使用率(%)',
type: 'value'
},
series: [{
@ -154,7 +154,8 @@ export default {
data: xAxis
},
yAxis: {
type: 'value'
type: 'value',
name: '流量(MB/s)'
},
series: [{
data: yAxis,
@ -188,7 +189,8 @@ export default {
data: xAxis
},
yAxis: {
type: 'value'
type: 'value',
name: '流量(MB/s)'
},
series: [{
data: yAxis,
@ -222,7 +224,8 @@ export default {
data: xAxis
},
yAxis: {
type: 'value'
type: 'value',
name: '使用率(%)',
},
series: [{
data: yAxis,