[alerter] 告警处理指标数据,告警表达式计算,内容模版关键字替换
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.usthe.alert;
|
||||
|
||||
import com.googlecode.aviator.AviatorEvaluator;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
/**
|
||||
* @author tomsun28
|
||||
* @date 2021/11/3 12:55
|
||||
*/
|
||||
@Configuration
|
||||
public class AlerterConfiguration {
|
||||
|
||||
private static final int AVIATOR_LRU_CACHE_SIZE = 1024;
|
||||
|
||||
@Bean
|
||||
public void configAviatorEvaluator() {
|
||||
// 配置AviatorEvaluator使用LRU缓存编译后的表达式
|
||||
AviatorEvaluator.getInstance()
|
||||
.useLRUExpressionCache(AVIATOR_LRU_CACHE_SIZE);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user