mirror of https://github.com/longtai-cn/hippo4j
Refactored thread pool monitoring (#816)
parent
04feb423ce
commit
8238c6555f
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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.monitor.base;
|
||||
|
||||
import cn.hippo4j.adapter.base.ThreadPoolAdapter;
|
||||
import cn.hippo4j.adapter.base.ThreadPoolAdapterState;
|
||||
import cn.hippo4j.common.config.ApplicationContextHolder;
|
||||
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* Abstract adapter thread-pool monitor.
|
||||
*/
|
||||
public abstract class AbstractAdapterThreadPoolMonitor implements AdapterThreadPoolMonitor {
|
||||
|
||||
/**
|
||||
* Execute collection thread pool running data.
|
||||
*
|
||||
* @param threadPoolAdapterState thread-pool adapter state
|
||||
*/
|
||||
protected abstract void execute(ThreadPoolAdapterState threadPoolAdapterState);
|
||||
|
||||
@Override
|
||||
public void collect() {
|
||||
Map<String, ThreadPoolAdapter> threadPoolAdapterMap = ApplicationContextHolder.getBeansOfType(ThreadPoolAdapter.class);
|
||||
threadPoolAdapterMap.forEach((beanName, bean) -> bean.getThreadPoolStates().forEach(each -> execute(each)));
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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.monitor.base;
|
||||
|
||||
import cn.hippo4j.adapter.web.WebThreadPoolService;
|
||||
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
/**
|
||||
* Abstract web thread-pool monitor.
|
||||
*/
|
||||
public abstract class AbstractWebThreadPoolMonitor implements WebThreadPoolMonitor {
|
||||
|
||||
@Resource
|
||||
private WebThreadPoolService webThreadPoolService;
|
||||
|
||||
/**
|
||||
* Execute collection thread pool running data.
|
||||
*
|
||||
* @param webThreadPoolRunStateInfo web thread-pool run state info
|
||||
*/
|
||||
protected abstract void execute(ThreadPoolRunStateInfo webThreadPoolRunStateInfo);
|
||||
|
||||
@Override
|
||||
public void collect() {
|
||||
ThreadPoolRunStateInfo webThreadPoolRunStateInfo = webThreadPoolService.getWebRunStateInfo();
|
||||
execute(webThreadPoolRunStateInfo);
|
||||
}
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.monitor.base;
|
||||
|
||||
/**
|
||||
* Adapter thread-pool monitor.
|
||||
*/
|
||||
public interface AdapterThreadPoolMonitor extends ThreadPoolMonitor {
|
||||
|
||||
}
|
30
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-micrometer/src/main/java/cn/hippo4j/springboot/starter/monitor/micrometer/MicrometerMonitorConfiguration.java → hippo4j-monitor/hippo4j-monitor-base/src/main/java/cn/hippo4j/monitor/base/MonitorThreadPoolTypeEnum.java
30
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-micrometer/src/main/java/cn/hippo4j/springboot/starter/monitor/micrometer/MicrometerMonitorConfiguration.java → hippo4j-monitor/hippo4j-monitor-base/src/main/java/cn/hippo4j/monitor/base/MonitorThreadPoolTypeEnum.java
@ -0,0 +1,25 @@
|
||||
/*
|
||||
* 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.monitor.base;
|
||||
|
||||
/**
|
||||
* Web thread-pool monitor.
|
||||
*/
|
||||
public interface WebThreadPoolMonitor extends ThreadPoolMonitor {
|
||||
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.monitor.elasticsearch;
|
||||
|
||||
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
|
||||
import cn.hippo4j.monitor.base.AbstractDynamicThreadPoolMonitor;
|
||||
import cn.hippo4j.monitor.base.MonitorTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Adapter thread-pool elastic-search monitor handler.
|
||||
*/
|
||||
@Slf4j
|
||||
public class AdapterThreadPoolElasticSearchMonitorHandler extends AbstractDynamicThreadPoolMonitor {
|
||||
|
||||
@Override
|
||||
protected void execute(ThreadPoolRunStateInfo poolRunStateInfo) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return MonitorTypeEnum.ELASTICSEARCH.name().toLowerCase();
|
||||
}
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* 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.monitor.elasticsearch;
|
||||
|
||||
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
|
||||
import cn.hippo4j.monitor.base.AbstractDynamicThreadPoolMonitor;
|
||||
import cn.hippo4j.monitor.base.MonitorTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Web thread-pool elastic-search monitor handler.
|
||||
*/
|
||||
@Slf4j
|
||||
public class WebThreadPoolElasticSearchMonitorHandler extends AbstractDynamicThreadPoolMonitor {
|
||||
|
||||
@Override
|
||||
protected void execute(ThreadPoolRunStateInfo poolRunStateInfo) {
|
||||
// TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return MonitorTypeEnum.ELASTICSEARCH.name().toLowerCase();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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.monitor.local.log;
|
||||
|
||||
import cn.hippo4j.adapter.base.ThreadPoolAdapterState;
|
||||
import cn.hippo4j.common.toolkit.JSONUtil;
|
||||
import cn.hippo4j.monitor.base.AbstractAdapterThreadPoolMonitor;
|
||||
import cn.hippo4j.monitor.base.MonitorTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Adapter thread-pool local log monitor handler.
|
||||
*/
|
||||
@Slf4j
|
||||
public class AdapterThreadPoolLocalLogMonitorHandler extends AbstractAdapterThreadPoolMonitor {
|
||||
|
||||
@Override
|
||||
protected void execute(ThreadPoolAdapterState threadPoolAdapterState) {
|
||||
log.info("{}", JSONUtil.toJSONString(threadPoolAdapterState));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return MonitorTypeEnum.LOG.name().toLowerCase();
|
||||
}
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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.monitor.local.log;
|
||||
|
||||
import cn.hippo4j.common.model.ThreadPoolRunStateInfo;
|
||||
import cn.hippo4j.common.toolkit.JSONUtil;
|
||||
import cn.hippo4j.monitor.base.AbstractWebThreadPoolMonitor;
|
||||
import cn.hippo4j.monitor.base.MonitorTypeEnum;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
|
||||
/**
|
||||
* Web thread-pool local log monitor handler.
|
||||
*/
|
||||
@Slf4j
|
||||
public class WebThreadPoolLocalLogMonitorHandler extends AbstractWebThreadPoolMonitor {
|
||||
|
||||
@Override
|
||||
protected void execute(ThreadPoolRunStateInfo poolRunStateInfo) {
|
||||
log.info("{}", JSONUtil.toJSONString(poolRunStateInfo));
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getType() {
|
||||
return MonitorTypeEnum.LOG.name().toLowerCase();
|
||||
}
|
||||
}
|
25
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-local-log/src/main/java/cn/hippo4j/springboot/starter/monitor/local/log/LocalLogMonitorConfiguration.java → hippo4j-monitor/hippo4j-monitor-micrometer/src/main/java/cn/hippo4j/monitor/micrometer/AdapterThreadPoolMicrometerMonitorHandler.java
25
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-local-log/src/main/java/cn/hippo4j/springboot/starter/monitor/local/log/LocalLogMonitorConfiguration.java → hippo4j-monitor/hippo4j-monitor-micrometer/src/main/java/cn/hippo4j/monitor/micrometer/AdapterThreadPoolMicrometerMonitorHandler.java
25
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-elasticsearch/src/main/java/cn/hippo4j/springboot/starter/monitor/es/EsMonitorAutoConfiguration.java → hippo4j-monitor/hippo4j-monitor-micrometer/src/main/java/cn/hippo4j/monitor/micrometer/WebThreadPoolMicrometerMonitorHandler.java
25
hippo4j-spring-boot/hippo4j-spring-boot-starter-monitor/hippo4j-spring-boot-starter-monitor-elasticsearch/src/main/java/cn/hippo4j/springboot/starter/monitor/es/EsMonitorAutoConfiguration.java → hippo4j-monitor/hippo4j-monitor-micrometer/src/main/java/cn/hippo4j/monitor/micrometer/WebThreadPoolMicrometerMonitorHandler.java
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* 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.config.springboot.starter.config;
|
||||
|
||||
import cn.hippo4j.monitor.base.MonitorThreadPoolTypeEnum;
|
||||
import lombok.Data;
|
||||
|
||||
/**
|
||||
* Thread pool monitoring properties.
|
||||
*/
|
||||
@Data
|
||||
public class MonitorProperties {
|
||||
|
||||
/**
|
||||
* Collect thread pool runtime indicators.
|
||||
*/
|
||||
private Boolean enable = Boolean.TRUE;
|
||||
|
||||
/**
|
||||
* Type of collection thread pool running data. eg: log,micrometer. Multiple can be used at the same time.
|
||||
*/
|
||||
private String collectTypes;
|
||||
|
||||
/**
|
||||
* Monitor the type of thread pool. eg: dynamic,web,adapter. Can be configured arbitrarily, default dynamic.
|
||||
*/
|
||||
private String threadPoolTypes = MonitorThreadPoolTypeEnum.DYNAMIC.toString().toLowerCase();
|
||||
|
||||
/**
|
||||
* Delay starting data acquisition task. unit: ms
|
||||
*/
|
||||
private Long initialDelay = 10000L;
|
||||
|
||||
/**
|
||||
* Collect interval. unit: ms
|
||||
*/
|
||||
private Long collectInterval = 5000L;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.springboot.starter.monitor.elasticsearch;
|
||||
|
||||
import cn.hippo4j.monitor.elasticsearch.AdapterThreadPoolElasticSearchMonitorHandler;
|
||||
import cn.hippo4j.monitor.elasticsearch.DynamicThreadPoolElasticSearchMonitorHandler;
|
||||
import cn.hippo4j.monitor.elasticsearch.WebThreadPoolElasticSearchMonitorHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Elastic-search monitor auto configuration.
|
||||
*/
|
||||
@Configuration
|
||||
public class ElasticSearchMonitorAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public DynamicThreadPoolElasticSearchMonitorHandler dynamicThreadPoolElasticSearchMonitorHandler() {
|
||||
return new DynamicThreadPoolElasticSearchMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebThreadPoolElasticSearchMonitorHandler webThreadPoolElasticSearchMonitorHandler() {
|
||||
return new WebThreadPoolElasticSearchMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AdapterThreadPoolElasticSearchMonitorHandler adapterThreadPoolElasticSearchMonitorHandler() {
|
||||
return new AdapterThreadPoolElasticSearchMonitorHandler();
|
||||
}
|
||||
}
|
@ -1 +1 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.monitor.es.EsMonitorAutoConfiguration
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.monitor.elasticsearch.ElasticSearchMonitorAutoConfiguration
|
||||
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.springboot.starter.monitor.local.log;
|
||||
|
||||
import cn.hippo4j.monitor.local.log.AdapterThreadPoolLocalLogMonitorHandler;
|
||||
import cn.hippo4j.monitor.local.log.DynamicThreadPoolLocalLogMonitorHandler;
|
||||
import cn.hippo4j.monitor.local.log.WebThreadPoolLocalLogMonitorHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Local log monitor auto configuration.
|
||||
*/
|
||||
@Configuration
|
||||
public class LocalLogMonitorAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public DynamicThreadPoolLocalLogMonitorHandler dynamicThreadPoolLocalLogMonitorHandler() {
|
||||
return new DynamicThreadPoolLocalLogMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebThreadPoolLocalLogMonitorHandler webThreadPoolLocalLogMonitorHandler() {
|
||||
return new WebThreadPoolLocalLogMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AdapterThreadPoolLocalLogMonitorHandler adapterThreadPoolLocalLogMonitorHandler() {
|
||||
return new AdapterThreadPoolLocalLogMonitorHandler();
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.monitor.local.log.LocalLogMonitorAutoConfiguration
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* 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.springboot.starter.monitor.micrometer;
|
||||
|
||||
import cn.hippo4j.monitor.micrometer.AdapterThreadPoolMicrometerMonitorHandler;
|
||||
import cn.hippo4j.monitor.micrometer.DynamicThreadPoolMicrometerMonitorHandler;
|
||||
import cn.hippo4j.monitor.micrometer.WebThreadPoolMicrometerMonitorHandler;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* Micrometer monitor auto configuration.
|
||||
*/
|
||||
@Configuration
|
||||
public class MicrometerMonitorAutoConfiguration {
|
||||
|
||||
@Bean
|
||||
public DynamicThreadPoolMicrometerMonitorHandler dynamicThreadPoolMicrometerMonitorHandler() {
|
||||
return new DynamicThreadPoolMicrometerMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public WebThreadPoolMicrometerMonitorHandler webThreadPoolMicrometerMonitorHandler() {
|
||||
return new WebThreadPoolMicrometerMonitorHandler();
|
||||
}
|
||||
|
||||
@Bean
|
||||
public AdapterThreadPoolMicrometerMonitorHandler adapterThreadPoolMicrometerMonitorHandler() {
|
||||
return new AdapterThreadPoolMicrometerMonitorHandler();
|
||||
}
|
||||
}
|
@ -0,0 +1 @@
|
||||
org.springframework.boot.autoconfigure.EnableAutoConfiguration=cn.hippo4j.springboot.starter.monitor.micrometer.MicrometerMonitorAutoConfiguration
|
Loading…
Reference in new issue