From af8b8b0a69fa125369ad28b9349e31ff58f0227b Mon Sep 17 00:00:00 2001 From: jsy Date: Mon, 18 Mar 2024 15:53:35 +0800 Subject: [PATCH] feat: support mysqlplugin of local collect (#821) --- .../home/biz/plugin/config/CollectType.java | 2 +- ...MetricConf.java => CollectMetricConf.java} | 6 ++-- .../integration/IntegrationTransForm.java | 1 + .../model/integration/mysql/MysqlTaskV3.java | 28 +++++++++++++++++++ .../registry/model/integration/ob/ObTask.java | 3 +- 5 files changed, 35 insertions(+), 5 deletions(-) rename server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/{ob/ObMetricConf.java => CollectMetricConf.java} (61%) create mode 100644 server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/mysql/MysqlTaskV3.java diff --git a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/config/CollectType.java b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/config/CollectType.java index dc2f49f3e..4502b2826 100644 --- a/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/config/CollectType.java +++ b/server/home/home-service/src/main/java/io/holoinsight/server/home/biz/plugin/config/CollectType.java @@ -9,6 +9,6 @@ * @version 1.0: CollectType.java, Date: 2023-08-09 Time: 14:59 */ public enum CollectType { - CENTER, LOCAL, OB_CLIENT + CENTER, LOCAL, OB_CLIENT, MYSQL_CLIENT } diff --git a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObMetricConf.java b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/CollectMetricConf.java similarity index 61% rename from server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObMetricConf.java rename to server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/CollectMetricConf.java index cc9b443ad..f24fb4ede 100644 --- a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObMetricConf.java +++ b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/CollectMetricConf.java @@ -1,7 +1,7 @@ /* * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. */ -package io.holoinsight.server.registry.model.integration.ob; +package io.holoinsight.server.registry.model.integration; import lombok.AllArgsConstructor; import lombok.Data; @@ -10,12 +10,12 @@ /** * * @author zzhb101 - * @version 1.0: ObMetricConf.java, v 0.1 2022年11月21日 下午12:02 jinsong.yjs Exp $ + * @version 1.0: CollectMetricConf.java, v 0.1 2022年11月21日 下午12:02 jinsong.yjs Exp $ */ @Data @AllArgsConstructor @NoArgsConstructor -public class ObMetricConf { +public class CollectMetricConf { public String name; public String metricType; } diff --git a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/IntegrationTransForm.java b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/IntegrationTransForm.java index 1fde658ea..2820dac2c 100644 --- a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/IntegrationTransForm.java +++ b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/IntegrationTransForm.java @@ -21,4 +21,5 @@ public class IntegrationTransForm { private List metricWhiteList; private Map> metricConfigs; + private List scripts; } diff --git a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/mysql/MysqlTaskV3.java b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/mysql/MysqlTaskV3.java new file mode 100644 index 000000000..e11ffee1f --- /dev/null +++ b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/mysql/MysqlTaskV3.java @@ -0,0 +1,28 @@ +/* + * Copyright 2022 Holoinsight Project Authors. Licensed under Apache-2.0. + */ + +package io.holoinsight.server.registry.model.integration.mysql; + +import io.holoinsight.server.registry.model.integration.CollectMetricConf; +import io.holoinsight.server.registry.model.integration.LocalIntegrationTask; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.NoArgsConstructor; + +import java.util.List; + +/** + * @author jsy1001de + * @version 1.0: MysqlTaskV3.java, Date: 2024-03-15 Time: 10:59 + */ +@EqualsAndHashCode(callSuper = true) +@Data +@NoArgsConstructor +public class MysqlTaskV3 extends LocalIntegrationTask { + private String username; + private String password; + public Integer port; + public String sql; + public List metrics; +} diff --git a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObTask.java b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObTask.java index 1251b406b..ebab64c08 100644 --- a/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObTask.java +++ b/server/registry/registry-model/src/main/java/io/holoinsight/server/registry/model/integration/ob/ObTask.java @@ -4,6 +4,7 @@ package io.holoinsight.server.registry.model.integration.ob; import io.holoinsight.server.registry.model.integration.LocalIntegrationTask; +import io.holoinsight.server.registry.model.integration.CollectMetricConf; import lombok.Data; import lombok.NoArgsConstructor; @@ -21,5 +22,5 @@ public class ObTask extends LocalIntegrationTask { public String network; public Integer port; public String dbName; - public List metrics; + public List metrics; }