This commit is contained in:
2023-12-26 12:15:14 +08:00
parent 6c91925517
commit 570f81e3f0
11 changed files with 98 additions and 123 deletions

View File

@@ -5,77 +5,14 @@ spring:
enabledCollect: true # 是否开启监控指标采集默认true
collectorTypes: logging,test_collect # 监控数据采集器类型logging | micrometer | internal_logging默认micrometer
logPath: C:\log\lms # 监控日志数据路径,默认 ${user.home}/logs采集类型非logging不用配置
monitorInterval: 5
executors: # 动态线程池配置,都有默认值,采用默认值的可以不配置该项,减少配置量
- threadPoolName: el-thread
threadPoolAliasName: 测试线程池 # 线程池别名
executorType: common # 线程池类型 common、eager、ordered、scheduled默认 common
corePoolSize: 6 # 核心线程数默认1
maximumPoolSize: 8 # 最大线程数默认cpu核数
queueCapacity: 2000 # 队列容量默认1024
queueType: VariableLinkedBlockingQueue # 任务队列查看源码QueueTypeEnum枚举类默认VariableLinkedBlockingQueue
rejectedHandlerType: CallerRunsPolicy # 拒绝策略查看RejectedTypeEnum枚举类默认AbortPolicy
keepAliveTime: 60 # 空闲线程等待超时时间默认60
threadNamePrefix: el-pool # 线程名前缀默认dtp
allowCoreThreadTimeOut: false # 是否允许核心线程池超时默认false
waitForTasksToCompleteOnShutdown: true # 参考spring线程池设计优雅关闭线程池默认false
awaitTerminationSeconds: 5 # 优雅关闭线程池时阻塞等待线程池中任务执行时间默认0单位s
preStartAllCoreThreads: false # 是否预热所有核心线程默认false
runTimeout: 200 # 任务执行超时阈值目前只做告警用单位ms默认0
queueTimeout: 100 # 任务在队列等待超时阈值目前只做告警用单位ms默认0
taskWrapperNames: [ "ttl", "mdc" ] # 任务包装器名称继承TaskWrapper接口
notifyEnabled: true # 是否开启报警默认true
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警、拒绝报警、任务超时报警)
- type: change
enabled: true
- type: capacity # 队列容量使用率,报警项类型,查看源码 NotifyTypeEnum枚举类
enabled: true
threshold: 80 # 报警阈值默认70意思是队列使用率达到70%告警
interval: 120 # 报警间隔单位s默认120
- type: liveness # 线程池活性
enabled: true
threshold: 80 # 报警阈值,默认 70意思是活性达到70%告警
- type: reject # 触发任务拒绝告警
enabled: true
threshold: 100 # 默认阈值10
- type: run_timeout # 任务执行超时告警
enabled: true
threshold: 100 # 默认阈值10
- type: queue_timeout # 任务排队超时告警
enabled: true
threshold: 100 # 默认阈值10
tomcat-tp:
threadPoolName: tomcatTp
monitorInterval: 8
tomcatTp: # tomcat webserver 线程池配置
threadPoolAliasName: tomcat 线程池 # 线程池别名,可选
corePoolSize: 100
maximumPoolSize: 200
keepAliveTime: 60
runTimeout: 200
queueTimeout: 100
notifyItems: # 报警项,不配置自动会按默认值配置(变更通知、容量报警、活性报警、拒绝报警、任务超时报警)
- type: change
enabled: true
- type: capacity # 队列容量使用率,报警项类型,查看源码 NotifyTypeEnum枚举类
enabled: true
threshold: 80 # 报警阈值默认70意思是队列使用率达到70%告警
interval: 120 # 报警间隔单位s默认120
- type: liveness # 线程池活性
enabled: true
threshold: 80 # 报警阈值,默认 70意思是活性达到70%告警
- type: reject # 触发任务拒绝告警
enabled: true
threshold: 100 # 默认阈值10
- type: run_timeout # 任务执行超时告警
enabled: true
threshold: 100 # 默认阈值10
- type: queue_timeout # 任务排队超时告警
enabled: true
threshold: 100
datasource:
druid:
initial-size: 5 #初始化时建立物理连接的个数