use of com.navercorp.pinpoint.web.alarm.DataCollectorCategory in project pinpoint by naver.
the class AlarmReader method addChecker.
private void addChecker(Application application) {
List<Rule> rules = alarmService.selectRuleByApplicationId(application.getName());
long timeSlotEndTime = System.currentTimeMillis();
Map<DataCollectorCategory, DataCollector> collectorMap = new HashMap<>();
for (Rule rule : rules) {
CheckerCategory checkerCategory = CheckerCategory.getValue(rule.getCheckerName());
AlarmCheckerFactory factory = checkerRegistry.getCheckerFactory(checkerCategory);
DataCollector collector = collectorMap.get(checkerCategory.getDataCollectorCategory());
if (collector == null) {
collector = dataCollectorFactory.createDataCollector(checkerCategory, application, timeSlotEndTime);
collectorMap.put(collector.getDataCollectorCategory(), collector);
}
AlarmChecker<?> checker = factory.createChecker(collector, rule);
checkers.add(checker);
}
}
Aggregations