use of com.navercorp.pinpoint.web.alarm.vo.CheckerResult in project pinpoint by naver.
the class AlarmServiceImpl method selectBeforeCheckerResults.
@Override
public Map<String, CheckerResult> selectBeforeCheckerResults(String applicationId) {
Map<String, CheckerResult> checkerResults = new HashMap<>();
List<CheckerResult> CheckerResultList = alarmDao.selectBeforeCheckerResultList(applicationId);
if (!CheckerResultList.isEmpty()) {
for (CheckerResult checkerResult : CheckerResultList) {
checkerResults.put(checkerResult.getCheckerName(), checkerResult);
}
}
return checkerResults;
}
use of com.navercorp.pinpoint.web.alarm.vo.CheckerResult in project pinpoint by naver.
the class AlarmServiceImpl method updateBeforeCheckerResult.
@Override
public void updateBeforeCheckerResult(CheckerResult beforeCheckerResult, AlarmChecker checker) {
alarmDao.deleteCheckerResult(beforeCheckerResult);
if (checker.isDetected()) {
beforeCheckerResult.setDetected(true);
beforeCheckerResult.increseCount();
alarmDao.insertCheckerResult(beforeCheckerResult);
} else {
alarmDao.insertCheckerResult(new CheckerResult(checker.getRule().getApplicationId(), checker.getRule().getCheckerName(), false, 0, 1));
}
}
use of com.navercorp.pinpoint.web.alarm.vo.CheckerResult in project pinpoint by naver.
the class AlarmWriter method write.
@Override
public void write(List<? extends AlarmChecker> checkers) throws Exception {
Map<String, CheckerResult> beforeCheckerResults = alarmService.selectBeforeCheckerResults(checkers.get(0).getRule().getApplicationId());
for (AlarmChecker checker : checkers) {
CheckerResult beforeCheckerResult = beforeCheckerResults.get(checker.getRule().getCheckerName());
if (beforeCheckerResult == null) {
beforeCheckerResult = new CheckerResult(checker.getRule().getApplicationId(), checker.getRule().getCheckerName(), false, 0, 1);
}
if (checker.isDetected()) {
sendAlarmMessage(beforeCheckerResult, checker);
}
alarmService.updateBeforeCheckerResult(beforeCheckerResult, checker);
}
}
Aggregations