From fb2ed3dd1a555d18d630b16fec2a406283202a26 Mon Sep 17 00:00:00 2001 From: CaptainB Date: Fri, 28 Oct 2022 14:39:28 +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=E5=A4=8D=E5=A2=9E=E5=8A=A0=E4=BA=86=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=9B=91=E6=8E=A7=E6=97=B6=E4=B8=8D=E8=83=BD=E6=AD=A3?= =?UTF-8?q?=E5=B8=B8=E6=98=BE=E7=A4=BA=E7=9B=91=E6=8E=A7=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../io/metersphere/service/MetricQueryService.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/performance-test/backend/src/main/java/io/metersphere/service/MetricQueryService.java b/performance-test/backend/src/main/java/io/metersphere/service/MetricQueryService.java index 5b60658e80..5b1549b78b 100644 --- a/performance-test/backend/src/main/java/io/metersphere/service/MetricQueryService.java +++ b/performance-test/backend/src/main/java/io/metersphere/service/MetricQueryService.java @@ -185,8 +185,9 @@ public class MetricQueryService { monitor.setName((String) m.get("name")); monitor.setPort(String.valueOf(m.get("port"))); monitor.setDescription((String) m.get("description")); - // todo - monitor.setMonitorConfig((List) m.get("monitorConfig")); + if (m.get("monitorConfig") instanceof String && StringUtils.isNotBlank((String) m.get("monitorConfig"))) { + monitor.setMonitorConfig(JSON.parseArray((String) m.get("monitorConfig"), MonitorItem.class)); + } instances.add(monitor); } @@ -290,8 +291,9 @@ public class MetricQueryService { monitor.setName((String) o.get("name")); monitor.setPort(String.valueOf(o.get("port"))); monitor.setDescription((String) o.get("description")); - // todo - monitor.setMonitorConfig((List) o.get("monitorConfig")); + if (o.get("monitorConfig") instanceof String && StringUtils.isNotBlank((String) o.get("monitorConfig"))) { + monitor.setMonitorConfig(JSON.parseArray((String) o.get("monitorConfig"), MonitorItem.class)); + } result.add(monitor); }