From 0913e6aa99c02e0276360f2cbc63a6e844a52d52 Mon Sep 17 00:00:00 2001 From: metersphere-bot <78466014+metersphere-bot@users.noreply.github.com> Date: Wed, 4 Aug 2021 10:30:24 +0800 Subject: [PATCH] =?UTF-8?q?fix(=E6=80=A7=E8=83=BD=E6=B5=8B=E8=AF=95):=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9prometheus=E5=86=85=E5=AD=98=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E7=8E=87=E6=9F=A5=E8=AF=A2=E5=85=AC=E5=BC=8F=20(#5220?= =?UTF-8?q?)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: BugKing --- .../metersphere/performance/controller/request/MetricQuery.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 49dda8162b..01c0693483 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 @@ -10,7 +10,7 @@ public class MetricQuery { // 指标名: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'} / 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("memory", "(node_memory_MemTotal_bytes{instance='%1$s'} - node_memory_MemAvailable_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])/1024)"); put("netOut", "sum by (instance) (irate(node_network_transmit_bytes_total{instance='%1$s',device!~'bond.*?|lo'}[1m])/1024)"); }};