From 3d2bb18b8cf27b9f98a59560fe30b525c23aed45 Mon Sep 17 00:00:00 2001 From: shiziyuan9527 Date: Thu, 15 Apr 2021 11:09:36 +0800 Subject: [PATCH] =?UTF-8?q?refactor(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):?= =?UTF-8?q?=20=E8=B0=83=E6=95=B4=E7=9B=91=E6=8E=A7=E5=9B=BE=E8=A1=A8?= =?UTF-8?q?=EF=BC=8C=E5=A2=9E=E5=8A=A0=E5=8D=95=E4=BD=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/request/MetricQuery.java | 2 +- .../report/components/MonitorCard.vue | 27 ++++++++++--------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/backend/src/main/java/io/metersphere/performance/controller/request/MetricQuery.java b/backend/src/main/java/io/metersphere/performance/controller/request/MetricQuery.java index 45287778a3..3aff727df3 100644 --- a/backend/src/main/java/io/metersphere/performance/controller/request/MetricQuery.java +++ b/backend/src/main/java/io/metersphere/performance/controller/request/MetricQuery.java @@ -9,7 +9,7 @@ public class MetricQuery { return new HashMap(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)"); diff --git a/frontend/src/business/components/performance/report/components/MonitorCard.vue b/frontend/src/business/components/performance/report/components/MonitorCard.vue index 785f8622ad..b120224dcd 100644 --- a/frontend/src/business/components/performance/report/components/MonitorCard.vue +++ b/frontend/src/business/components/performance/report/components/MonitorCard.vue @@ -3,25 +3,23 @@ - + - + - - - + - - - - + + + + @@ -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,