Search in sources :

Example 1 with DataCollectorCategory

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);
    }
}
Also used : CheckerCategory(com.navercorp.pinpoint.web.alarm.CheckerCategory) DataCollectorCategory(com.navercorp.pinpoint.web.alarm.DataCollectorCategory) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) DataCollector(com.navercorp.pinpoint.batch.alarm.collector.DataCollector)

Aggregations

DataCollector (com.navercorp.pinpoint.batch.alarm.collector.DataCollector)1 CheckerCategory (com.navercorp.pinpoint.web.alarm.CheckerCategory)1 DataCollectorCategory (com.navercorp.pinpoint.web.alarm.DataCollectorCategory)1 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)1