use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class WriterTest method emailSendTest.
@Ignore
@Test
public void emailSendTest() throws Exception {
Rule rule = new Rule("testService", "tomcat", CheckerCategory.SLOW_COUNT.getName(), 100, "testGroup", false, true, "");
SlowCountChecker checker = new SlowCountChecker(null, rule) {
@Override
public boolean isDetected() {
return true;
}
@Override
protected long getDetectedValue() {
return 10000;
}
};
List<AlarmChecker> checkers = new LinkedList<AlarmChecker>();
checkers.add(checker);
writer.write(checkers);
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class ErrorCountCheckerTest method checkTest1.
/*
* alert conditions not satisfied
*/
@Test
public void checkTest1() {
Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
ResponseTimeDataCollector collector = new ResponseTimeDataCollector(DataCollectorCategory.RESPONSE_TIME, application, mockMapResponseDAO, System.currentTimeMillis(), 300000);
Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.ERROR_COUNT.getName(), 74, "testGroup", false, false, "");
ErrorCountChecker filter = new ErrorCountChecker(collector, rule);
filter.check();
assertTrue(filter.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class ErrorCountToCalleCheckerTest method checkTest.
@Test
public void checkTest() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.ERROR_COUNT_TO_CALLEE.getName(), 5, "testGroup", false, false, TO_SERVICE_NAME + 1);
ErrorCountToCalleeChecker checker = new ErrorCountToCalleeChecker(dataCollector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class ErrorCountToCalleCheckerTest method checkTest3.
@Test
public void checkTest3() {
Application application = new Application(FROM_SERVICE_NAME, ServiceType.STAND_ALONE);
MapStatisticsCallerDataCollector dataCollector = new MapStatisticsCallerDataCollector(DataCollectorCategory.CALLER_STAT, application, dao, System.currentTimeMillis(), 300000);
Rule rule = new Rule(FROM_SERVICE_NAME, SERVICE_TYPE, CheckerCategory.ERROR_COUNT_TO_CALLEE.getName(), 5, "testGroup", false, false, TO_SERVICE_NAME + 2);
ErrorCountToCalleeChecker checker = new ErrorCountToCalleeChecker(dataCollector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class ErrorRateCheckerTest method checkTest2.
/*
* alert conditions not satisfied
*/
@Test
public void checkTest2() {
Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
ResponseTimeDataCollector collector = new ResponseTimeDataCollector(DataCollectorCategory.RESPONSE_TIME, application, mockMapResponseDAO, System.currentTimeMillis(), 300000);
Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.ERROR_RATE.getName(), 61, "testGroup", false, false, "");
ErrorRateChecker filter = new ErrorRateChecker(collector, rule);
filter.check();
assertFalse(filter.isDetected());
}
Aggregations