@EnableDynamicThreadPool controls MicrometerMonitorAutoConfiguration (#1380)

pull/1381/head
zjHe 1 year ago committed by GitHub
parent b1e181d5b2
commit d3e76ff668
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -18,9 +18,11 @@
package cn.hippo4j.springboot.starter.monitor.elasticsearch;
import cn.hippo4j.common.constant.Constants;
import cn.hippo4j.core.enable.MarkerConfiguration;
import cn.hippo4j.monitor.elasticsearch.AdapterThreadPoolElasticSearchMonitorHandler;
import cn.hippo4j.monitor.elasticsearch.DynamicThreadPoolElasticSearchMonitorHandler;
import cn.hippo4j.monitor.elasticsearch.WebThreadPoolElasticSearchMonitorHandler;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnExpression;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
@ -30,6 +32,7 @@ import org.springframework.context.annotation.Configuration;
* Elastic-search monitor auto configuration.
*/
@Configuration
@ConditionalOnBean(MarkerConfiguration.Marker.class)
@ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.collect-types:}'.contains('elasticsearch')")
@ConditionalOnProperty(prefix = Constants.CONFIGURATION_PROPERTIES_PREFIX, value = "enable", matchIfMissing = true, havingValue = "true")
public class ElasticSearchMonitorAutoConfiguration {

@ -19,6 +19,7 @@ package cn.hippo4j.springboot.starter.monitor.local.log;
import cn.hippo4j.adapter.web.WebThreadPoolService;
import cn.hippo4j.common.constant.Constants;
import cn.hippo4j.core.enable.MarkerConfiguration;
import cn.hippo4j.monitor.local.log.AdapterThreadPoolLocalLogMonitorHandler;
import cn.hippo4j.monitor.local.log.DynamicThreadPoolLocalLogMonitorHandler;
import cn.hippo4j.monitor.local.log.WebThreadPoolLocalLogMonitorHandler;
@ -32,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
* Local log monitor auto configuration.
*/
@Configuration
@ConditionalOnBean(MarkerConfiguration.Marker.class)
@ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.collect-types:}'.contains('log')")
@ConditionalOnProperty(prefix = Constants.CONFIGURATION_PROPERTIES_PREFIX, value = "enable", matchIfMissing = true, havingValue = "true")
public class LocalLogMonitorAutoConfiguration {

@ -19,6 +19,7 @@ package cn.hippo4j.springboot.starter.monitor.micrometer;
import cn.hippo4j.adapter.web.WebThreadPoolService;
import cn.hippo4j.common.constant.Constants;
import cn.hippo4j.core.enable.MarkerConfiguration;
import cn.hippo4j.monitor.micrometer.AdapterThreadPoolMicrometerMonitorHandler;
import cn.hippo4j.monitor.micrometer.DynamicThreadPoolMicrometerMonitorHandler;
import cn.hippo4j.monitor.micrometer.WebThreadPoolMicrometerMonitorHandler;
@ -32,6 +33,7 @@ import org.springframework.context.annotation.Configuration;
* Micrometer monitor auto configuration.
*/
@Configuration
@ConditionalOnBean(MarkerConfiguration.Marker.class)
@ConditionalOnExpression("'${spring.dynamic.thread-pool.monitor.collect-types:}'.contains('micrometer')")
@ConditionalOnProperty(prefix = Constants.CONFIGURATION_PROPERTIES_PREFIX, value = "enable", matchIfMissing = true, havingValue = "true")
public class MicrometerMonitorAutoConfiguration {

Loading…
Cancel
Save