mirror of https://github.com/longtai-cn/hippo4j
parent
7be9fd542a
commit
bea61eadb3
@ -0,0 +1,78 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<parent>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-example</artifactId>
|
||||
<version>${revision}</version>
|
||||
</parent>
|
||||
<artifactId>hippo4j-spring-boot-starter-es-monitor-example</artifactId>
|
||||
|
||||
<properties>
|
||||
<maven.deploy.skip>true</maven.deploy.skip>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-example-core</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>cn.hippo4j</groupId>
|
||||
<artifactId>hippo4j-core-spring-boot-starter</artifactId>
|
||||
<version>${revision}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.apache.tomcat.embed</groupId>
|
||||
<artifactId>tomcat-embed-core</artifactId>
|
||||
<version>${tomcat-embed-core.version}</version>
|
||||
</dependency>
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-web</artifactId>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-tomcat</artifactId>
|
||||
</exclusion>
|
||||
</exclusions>
|
||||
</dependency>-->
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-undertow</artifactId>
|
||||
</dependency>-->
|
||||
|
||||
<!--<dependency>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-starter-jetty</artifactId>
|
||||
</dependency>-->
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<finalName>${project.artifactId}</finalName>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.springframework.boot</groupId>
|
||||
<artifactId>spring-boot-maven-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
<goal>repackage</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
</project>
|
@ -0,0 +1,31 @@
|
||||
/*
|
||||
* Licensed to the Apache Software Foundation (ASF) under one or more
|
||||
* contributor license agreements. See the NOTICE file distributed with
|
||||
* this work for additional information regarding copyright ownership.
|
||||
* The ASF licenses this file to You under the Apache License, Version 2.0
|
||||
* (the "License"); you may not use this file except in compliance with
|
||||
* the License. You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
package cn.hippo4j.example.es.monitor;
|
||||
|
||||
import cn.hippo4j.core.enable.EnableDynamicThreadPool;
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
|
||||
@EnableDynamicThreadPool
|
||||
@SpringBootApplication(scanBasePackages = {"cn.hippo4j.example.core", "cn.hippo4j.monitor"})
|
||||
public class Hippo4JExampleEsMonitorApplication {
|
||||
|
||||
public static void main(String[] args) {
|
||||
SpringApplication.run(Hippo4JExampleEsMonitorApplication.class, args);
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
server.port=8088
|
||||
|
||||
server.servlet.context-path=/example
|
||||
|
||||
spring.profiles.active=dev
|
||||
spring.application.name=dynamic-threadpool-example
|
||||
|
||||
es.host = xxx
|
||||
es.scheme = xxx
|
||||
es.userName = xxx
|
||||
es.password = xxx
|
||||
es.thread-pool-state.index.name = thread-pool-state
|
||||
|
||||
spring.dynamic.thread-pool.item-id=test
|
||||
spring.dynamic.thread-pool.enable=true
|
||||
spring.dynamic.thread-pool.banner=false
|
||||
spring.dynamic.thread-pool.collect=true
|
||||
spring.dynamic.thread-pool.collect-type=es
|
||||
spring.dynamic.thread-pool.notify-platforms[0].platform=DING
|
||||
spring.dynamic.thread-pool.notify-platforms[0].token=xxx
|
||||
spring.dynamic.thread-pool.notify-platforms[0].secret=xxx
|
||||
spring.dynamic.thread-pool.apollo.namespace=threadpool.yaml
|
||||
spring.dynamic.thread-pool.config-file-type=yaml
|
||||
spring.dynamic.thread-pool.alarm=true
|
||||
spring.dynamic.thread-pool.check-state-interval=3000
|
||||
spring.dynamic.thread-pool.capacity-alarm=80
|
||||
spring.dynamic.thread-pool.alarm-interval=8
|
||||
spring.dynamic.thread-pool.executors[0].thread-pool-id=message-consume
|
||||
spring.dynamic.thread-pool.executors[0].core-pool-size=32
|
||||
spring.dynamic.thread-pool.executors[0].maximum-pool-size=32
|
||||
spring.dynamic.thread-pool.executors[0].queue-capacity=999
|
||||
spring.dynamic.thread-pool.executors[0].execute-time-out=1500
|
||||
spring.dynamic.thread-pool.executors[0].blocking-queue=ResizableCapacityLinkedBlockIngQueue
|
||||
spring.dynamic.thread-pool.executors[0].rejected-handler=CallerRunsPolicy
|
||||
spring.dynamic.thread-pool.executors[0].keep-alive-time=1024
|
||||
spring.dynamic.thread-pool.executors[0].allow-core-thread-time-out=true
|
||||
spring.dynamic.thread-pool.executors[0].thread-name-prefix=untimely-thread-pool
|
||||
spring.dynamic.thread-pool.executors[0].notify.is-alarm=true
|
||||
spring.dynamic.thread-pool.executors[0].notify.capacity-alarm=20
|
||||
spring.dynamic.thread-pool.executors[0].notify.interval=2
|
||||
spring.dynamic.thread-pool.executors[0].notify.receive=xxx
|
@ -0,0 +1,19 @@
|
||||
package cn.hippo4j.monitor.es.model;
|
||||
|
||||
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
|
||||
import lombok.Getter;
|
||||
import lombok.Setter;
|
||||
|
||||
/**
|
||||
* Create by yuyang
|
||||
* 2022/8/4 17:17
|
||||
*/
|
||||
@Getter
|
||||
@Setter
|
||||
public class EsThreadPoolRunStateInfo extends ThreadPoolRunStateInfo{
|
||||
|
||||
private String Id;
|
||||
|
||||
private String applicationName;
|
||||
|
||||
}
|
@ -0,0 +1,78 @@
|
||||
{
|
||||
"_doc": {
|
||||
"properties": {
|
||||
"activeSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"applicationName": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"clientLastRefreshTime": {
|
||||
"type": "text"
|
||||
},
|
||||
"completedTaskCount": {
|
||||
"type": "long"
|
||||
},
|
||||
"coreSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"currentLoad": {
|
||||
"type": "text"
|
||||
},
|
||||
"freeMemory": {
|
||||
"type": "text"
|
||||
},
|
||||
"host": {
|
||||
"type": "keyword"
|
||||
},
|
||||
"id": {
|
||||
"type": "text"
|
||||
},
|
||||
"largestPoolSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"maximumSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"memoryProportion": {
|
||||
"type": "text"
|
||||
},
|
||||
"peakLoad": {
|
||||
"type": "text"
|
||||
},
|
||||
"poolSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"queueCapacity": {
|
||||
"type": "long"
|
||||
},
|
||||
"queueRemainingCapacity": {
|
||||
"type": "long"
|
||||
},
|
||||
"queueSize": {
|
||||
"type": "long"
|
||||
},
|
||||
"queueType": {
|
||||
"type": "text"
|
||||
},
|
||||
"rejectCount": {
|
||||
"type": "long"
|
||||
},
|
||||
"rejectedName": {
|
||||
"type": "text"
|
||||
},
|
||||
"simpleCurrentLoad": {
|
||||
"type": "long"
|
||||
},
|
||||
"simplePeakLoad": {
|
||||
"type": "long"
|
||||
},
|
||||
"timestamp": {
|
||||
"type": "date"
|
||||
},
|
||||
"tpId": {
|
||||
"type": "keyword"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in new issue