Skip to content

Commit d31872b

Browse files
committed
[ISSUE dromara#504] change config prefix from 'spring.dynamic.tp' to 'dynamictp'
1 parent 0c0fee1 commit d31872b

File tree

47 files changed

+1688
-1721
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+1688
-1721
lines changed

adapter/adapter-common/src/main/java/org/dromara/dynamictp/adapter/common/AbstractDtpAdapter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ public abstract class AbstractDtpAdapter implements DtpAdapter {
7474

7575
protected final Map<String, ExecutorWrapper> executors = Maps.newHashMap();
7676

77-
public AbstractDtpAdapter() {
77+
protected AbstractDtpAdapter() {
7878
EventBusManager.register(this);
7979
}
8080

adapter/adapter-common/src/main/java/org/dromara/dynamictp/adapter/common/DtpAdapterListener.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@
1818
package org.dromara.dynamictp.adapter.common;
1919

2020
import com.google.common.eventbus.Subscribe;
21+
import lombok.extern.slf4j.Slf4j;
22+
import lombok.val;
23+
import org.apache.commons.collections4.MapUtils;
2124
import org.dromara.dynamictp.common.event.AlarmCheckEvent;
2225
import org.dromara.dynamictp.common.event.CollectEvent;
2326
import org.dromara.dynamictp.common.event.RefreshEvent;
@@ -26,9 +29,7 @@
2629
import org.dromara.dynamictp.common.properties.DtpProperties;
2730
import org.dromara.dynamictp.core.handler.CollectorHandler;
2831
import org.dromara.dynamictp.core.notifier.manager.AlarmManager;
29-
import lombok.extern.slf4j.Slf4j;
30-
import lombok.val;
31-
import org.apache.commons.collections4.MapUtils;
32+
3233
import java.util.EventObject;
3334

3435
import static org.dromara.dynamictp.common.constant.DynamicTpConst.SCHEDULE_NOTIFY_ITEMS;
@@ -47,7 +48,7 @@ public DtpAdapterListener() {
4748
}
4849

4950
@Subscribe
50-
public void handleRefreshedEvent(EventObject event) {
51+
public void handleDtpEvent(EventObject event) {
5152
try {
5253
if (event instanceof RefreshEvent) {
5354
RefreshEvent refreshEvent = (RefreshEvent) event;

common/src/main/java/org/dromara/dynamictp/common/constant/DynamicTpConst.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ public final class DynamicTpConst {
3232

3333
private DynamicTpConst() { }
3434

35-
public static final String MAIN_PROPERTIES_PREFIX = "spring.dynamic.tp";
35+
public static final String MAIN_PROPERTIES_PREFIX = "dynamictp";
3636

3737
public static final String DTP_ENABLED_PROP = MAIN_PROPERTIES_PREFIX + ".enabled";
3838

common/src/main/java/org/dromara/dynamictp/common/event/DtpEvent.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ public abstract class DtpEvent extends EventObject {
3333

3434
private final transient DtpProperties dtpProperties;
3535

36-
public DtpEvent(Object source, DtpProperties dtpProperties) {
36+
protected DtpEvent(Object source, DtpProperties dtpProperties) {
3737
super(source);
3838
this.dtpProperties = dtpProperties;
3939
}

example/example-adapter/example-adapter-brpc/src/main/resources/application.yml

Lines changed: 21 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,28 +7,27 @@ spring:
77
profiles:
88
active: dev
99

10-
dynamic:
11-
tp:
12-
enabled: true
13-
enabledCollect: true # 是否开启监控指标采集,默认false
14-
collectorTypes: micrometer # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
15-
monitorInterval: 5
16-
platforms: # 通知报警平台配置
17-
- platform: wechat
18-
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
19-
receivers: test1,test2 # 接受人企微名称
20-
- platform: ding
21-
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
22-
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
23-
receivers: 15810119805 # 钉钉账号手机号
24-
- platform: lark
25-
urlKey: 0d944ae7-b24a-40 # 替换
26-
receivers: test1,test2 # 接受人飞书名称/openid
27-
brpcTp: # brpc 线程池配置
28-
- threadPoolName: rpc#server # 名称规则:biz_thread_pool_name + "#" + client/server
29-
corePoolSize: 100
30-
maximumPoolSize: 200
31-
keepAliveTime: 60
10+
dynamictp:
11+
enabled: true
12+
enabledCollect: true # 是否开启监控指标采集,默认false
13+
collectorTypes: micrometer # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
14+
monitorInterval: 5
15+
platforms: # 通知报警平台配置
16+
- platform: wechat
17+
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
18+
receivers: test1,test2 # 接受人企微名称
19+
- platform: ding
20+
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
21+
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
22+
receivers: 15810119805 # 钉钉账号手机号
23+
- platform: lark
24+
urlKey: 0d944ae7-b24a-40 # 替换
25+
receivers: test1,test2 # 接受人飞书名称/openid
26+
brpcTp: # brpc 线程池配置
27+
- threadPoolName: rpc#server # 名称规则:biz_thread_pool_name + "#" + client/server
28+
corePoolSize: 100
29+
maximumPoolSize: 200
30+
keepAliveTime: 60
3231

3332
starlight:
3433
server:

example/example-adapter/example-adapter-dubbo/example-adapter-alibaba-dubbo/src/main/resources/application.yml

Lines changed: 22 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,28 @@ spring:
77
profiles:
88
active: dev
99

10-
dynamic:
11-
tp:
12-
enabled: true
13-
enabledCollect: true # 是否开启监控指标采集,默认false
14-
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
15-
monitorInterval: 5
16-
platforms: # 通知报警平台配置
17-
- platform: wechat
18-
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
19-
receivers: test1,test2 # 接受人企微名称
20-
- platform: ding
21-
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
22-
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
23-
receivers: 15810119805 # 钉钉账号手机号
24-
- platform: lark
25-
urlKey: 0d944ae7-b24a-40 # 替换
26-
receivers: test1,test2 # 接受人飞书名称/openid
27-
dubboTp: # dubbo 线程池配置
28-
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
29-
threadPoolAliasName: 测试线程池
30-
corePoolSize: 100
31-
maximumPoolSize: 200
32-
keepAliveTime: 60
10+
dynamictp:
11+
enabled: true
12+
enabledCollect: true # 是否开启监控指标采集,默认false
13+
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
14+
monitorInterval: 5
15+
platforms: # 通知报警平台配置
16+
- platform: wechat
17+
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
18+
receivers: test1,test2 # 接受人企微名称
19+
- platform: ding
20+
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
21+
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
22+
receivers: 15810119805 # 钉钉账号手机号
23+
- platform: lark
24+
urlKey: 0d944ae7-b24a-40 # 替换
25+
receivers: test1,test2 # 接受人飞书名称/openid
26+
dubboTp: # dubbo 线程池配置
27+
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
28+
threadPoolAliasName: 测试线程池
29+
corePoolSize: 100
30+
maximumPoolSize: 200
31+
keepAliveTime: 60
3332

3433
dubbo:
3534
application:

example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-2.7.3/src/main/resources/application.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,34 @@ spring:
77
profiles:
88
active: dev
99

10-
dynamic:
11-
tp:
12-
enabled: true
13-
enabledCollect: true # 是否开启监控指标采集,默认false
14-
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
15-
monitorInterval: 5
16-
platforms: # 通知报警平台配置
17-
- platform: wechat
18-
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
19-
receivers: test1,test2 # 接受人企微名称
20-
- platform: ding
21-
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
22-
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
23-
receivers: 15810119805 # 钉钉账号手机号
24-
- platform: lark
25-
urlKey: 0d944ae7-b24a-40 # 替换
26-
receivers: test1,test2 # 接受人飞书名称/openid
27-
dubboTp: # dubbo 线程池配置
28-
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
29-
threadPoolAliasName: 测试线程池
30-
corePoolSize: 100
31-
maximumPoolSize: 200
32-
keepAliveTime: 60
33-
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
34-
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
35-
enabled: true
36-
threshold: 80 # 报警阈值
37-
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
38-
interval: 120 # 报警间隔(单位:s)
10+
dynamictp:
11+
enabled: true
12+
enabledCollect: true # 是否开启监控指标采集,默认false
13+
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
14+
monitorInterval: 5
15+
platforms: # 通知报警平台配置
16+
- platform: wechat
17+
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
18+
receivers: test1,test2 # 接受人企微名称
19+
- platform: ding
20+
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
21+
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
22+
receivers: 15810119805 # 钉钉账号手机号
23+
- platform: lark
24+
urlKey: 0d944ae7-b24a-40 # 替换
25+
receivers: test1,test2 # 接受人飞书名称/openid
26+
dubboTp: # dubbo 线程池配置
27+
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
28+
threadPoolAliasName: 测试线程池
29+
corePoolSize: 100
30+
maximumPoolSize: 200
31+
keepAliveTime: 60
32+
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
33+
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
34+
enabled: true
35+
threshold: 80 # 报警阈值
36+
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
37+
interval: 120 # 报警间隔(单位:s)
3938

4039
dubbo:
4140
application:

example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-2.7.9/src/main/resources/application.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,34 @@ spring:
77
profiles:
88
active: dev
99

10-
dynamic:
11-
tp:
12-
enabled: true
13-
enabledCollect: true # 是否开启监控指标采集,默认false
14-
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
15-
monitorInterval: 5
16-
platforms: # 通知报警平台配置
17-
- platform: wechat
18-
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
19-
receivers: test1,test2 # 接受人企微名称
20-
- platform: ding
21-
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
22-
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
23-
receivers: 15810119805 # 钉钉账号手机号
24-
- platform: lark
25-
urlKey: 0d944ae7-b24a-40 # 替换
26-
receivers: test1,test2 # 接受人飞书名称/openid
27-
dubboTp: # dubbo 线程池配置
28-
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
29-
threadPoolAliasName: 测试线程池
30-
corePoolSize: 100
31-
maximumPoolSize: 200
32-
keepAliveTime: 60
33-
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
34-
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
35-
enabled: true
36-
threshold: 80 # 报警阈值
37-
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
38-
interval: 120 # 报警间隔(单位:s)
10+
dynamictp:
11+
enabled: true
12+
enabledCollect: true # 是否开启监控指标采集,默认false
13+
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
14+
monitorInterval: 5
15+
platforms: # 通知报警平台配置
16+
- platform: wechat
17+
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
18+
receivers: test1,test2 # 接受人企微名称
19+
- platform: ding
20+
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
21+
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
22+
receivers: 15810119805 # 钉钉账号手机号
23+
- platform: lark
24+
urlKey: 0d944ae7-b24a-40 # 替换
25+
receivers: test1,test2 # 接受人飞书名称/openid
26+
dubboTp: # dubbo 线程池配置
27+
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
28+
threadPoolAliasName: 测试线程池
29+
corePoolSize: 100
30+
maximumPoolSize: 200
31+
keepAliveTime: 60
32+
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
33+
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
34+
enabled: true
35+
threshold: 80 # 报警阈值
36+
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
37+
interval: 120 # 报警间隔(单位:s)
3938

4039
dubbo:
4140
application:

example/example-adapter/example-adapter-dubbo/example-adapter-apache-dubbo/example-adapter-apache-dubbo-3.0.7/src/main/resources/application.yml

Lines changed: 28 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -7,35 +7,34 @@ spring:
77
profiles:
88
active: dev
99

10-
dynamic:
11-
tp:
12-
enabled: true
13-
enabledCollect: true # 是否开启监控指标采集,默认false
14-
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
15-
monitorInterval: 5
16-
platforms: # 通知报警平台配置
17-
- platform: wechat
18-
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
19-
receivers: test1,test2 # 接受人企微名称
20-
- platform: ding
21-
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
22-
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
23-
receivers: 15810119805 # 钉钉账号手机号
24-
- platform: lark
25-
urlKey: 0d944ae7-b24a-40 # 替换
26-
receivers: test1,test2 # 接受人飞书名称/openid
27-
dubboTp: # dubbo 线程池配置
28-
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
29-
threadPoolAliasName: 测试线程池
30-
corePoolSize: 100
31-
maximumPoolSize: 200
32-
keepAliveTime: 60
33-
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
34-
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
35-
enabled: true
36-
threshold: 80 # 报警阈值
37-
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
38-
interval: 120 # 报警间隔(单位:s)
10+
dynamictp:
11+
enabled: true
12+
enabledCollect: true # 是否开启监控指标采集,默认false
13+
collectorTypes: logging # 监控数据采集器类型(logging | micrometer | internal_logging),默认micrometer
14+
monitorInterval: 5
15+
platforms: # 通知报警平台配置
16+
- platform: wechat
17+
urlKey: 3a7500-1287-4bd-a798-c5c3d8b69c # 替换
18+
receivers: test1,test2 # 接受人企微名称
19+
- platform: ding
20+
urlKey: f80dad441fcd655438f4a08dcd6a # 替换
21+
secret: SECb5441fa6f375d5b9d21 # 替换,非sign模式可以没有此值
22+
receivers: 15810119805 # 钉钉账号手机号
23+
- platform: lark
24+
urlKey: 0d944ae7-b24a-40 # 替换
25+
receivers: test1,test2 # 接受人飞书名称/openid
26+
dubboTp: # dubbo 线程池配置
27+
- threadPoolName: dubboTp#20880 # 名称规则:dubboTp + "#" + 协议端口
28+
threadPoolAliasName: 测试线程池
29+
corePoolSize: 100
30+
maximumPoolSize: 200
31+
keepAliveTime: 60
32+
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警)
33+
- type: capacity # 报警项类型,查看源码 NotifyTypeEnum枚举类
34+
enabled: true
35+
threshold: 80 # 报警阈值
36+
platforms: [ ding,wechat ] # 可选配置,不配置默认拿上层platforms配置的所以平台
37+
interval: 120 # 报警间隔(单位:s)
3938

4039
dubbo:
4140
application:

0 commit comments

Comments
 (0)