Merge pull request #482 from mabaiwan/develop

hippo4j-monitor code naming and log optimization
pull/483/head
小马哥 2 years ago committed by GitHub
commit 9d26e840be
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -17,15 +17,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -22,5 +22,23 @@ package com.example.monitor.base;
*/
public enum MonitorTypeEnum {
LOG, PROMETHEUS, SERVER, ES
/**
* LOG
*/
LOG,
/**
* PROMETHEUS
*/
PROMETHEUS,
/**
* SERVER
*/
SERVER,
/**
* ES
*/
ES
}

@ -9,6 +9,10 @@
</parent>
<artifactId>hippo4j-monitor-es</artifactId>
<properties>
<elasticsearch.version>6.5.0</elasticsearch.version>
</properties>
<dependencies>
<dependency>
<groupId>cn.hippo4j</groupId>
@ -27,11 +31,13 @@
<artifactId>elasticsearch</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>transport</artifactId>
<version>${elasticsearch.version}</version>
</dependency>
<dependency>
<groupId>org.elasticsearch.client</groupId>
<artifactId>elasticsearch-rest-high-level-client</artifactId>
@ -40,15 +46,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -25,6 +25,7 @@ import cn.hippo4j.monitor.es.model.EsThreadPoolRunStateInfo;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.io.FileUtil;
import com.example.monitor.base.AbstractDynamicThreadPoolMonitor;
import com.example.monitor.base.MonitorTypeEnum;
import lombok.extern.slf4j.Slf4j;
import org.elasticsearch.action.admin.indices.alias.Alias;
import org.elasticsearch.action.admin.indices.create.CreateIndexRequest;
@ -144,6 +145,6 @@ public class EsMonitorHandler extends AbstractDynamicThreadPoolMonitor {
@Override
public String getType() {
return "es";
return MonitorTypeEnum.ES.name().toLowerCase();
}
}

@ -18,15 +18,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -21,10 +21,11 @@ import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
import cn.hippo4j.common.toolkit.JSONUtil;
import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler;
import com.example.monitor.base.AbstractDynamicThreadPoolMonitor;
import com.example.monitor.base.MonitorTypeEnum;
import lombok.extern.slf4j.Slf4j;
/**
* Log monitor handler
* Log monitor handler.
*/
@Slf4j
public class LogMonitorHandler extends AbstractDynamicThreadPoolMonitor {
@ -40,6 +41,6 @@ public class LogMonitorHandler extends AbstractDynamicThreadPoolMonitor {
@Override
public String getType() {
return "log";
return MonitorTypeEnum.LOG.name().toLowerCase();
}
}

@ -24,15 +24,6 @@
</dependencies>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -22,6 +22,7 @@ import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
import cn.hippo4j.core.executor.state.ThreadPoolRunStateHandler;
import cn.hutool.core.bean.BeanUtil;
import com.example.monitor.base.AbstractDynamicThreadPoolMonitor;
import com.example.monitor.base.MonitorTypeEnum;
import com.google.common.collect.Lists;
import com.google.common.collect.Maps;
import io.micrometer.core.instrument.Metrics;
@ -84,6 +85,6 @@ public class PrometheusMonitorHandler extends AbstractDynamicThreadPoolMonitor {
@Override
public String getType() {
return "prometheus";
return MonitorTypeEnum.PROMETHEUS.name().toLowerCase();
}
}

@ -12,21 +12,12 @@
<modules>
<module>hippo4j-monitor-base</module>
<module>hippo4j-monitor-es</module>
<module>hippo4j-monitor-log</module>
<module>hippo4j-monitor-prometheus</module>
<module>hippo4j-monitor-es</module>
</modules>
<build>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*.txt</include>
<include>**/*.json</include>
</includes>
</resource>
</resources>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>

@ -55,7 +55,6 @@
<spring-cloud-starter-stream-rocketmq.version>2.2.6.RELEASE</spring-cloud-starter-stream-rocketmq.version>
<spring-cloud-starter-netflix-hystrix.version>2.2.9.RELEASE</spring-cloud-starter-netflix-hystrix.version>
<spring-cloud-starter-alibaba-nacos-config.version>2.2.5.RELEASE</spring-cloud-starter-alibaba-nacos-config.version>
<elasticsearch.version>6.5.0</elasticsearch.version>
<!-- Maven & Build -->
<java.version>1.8</java.version>

Loading…
Cancel
Save