use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class ResponseCountCheckerTest 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(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.TOTAL_COUNT.getName(), 125, "testGroup", false, false, "");
ResponseCountChecker filter = new ResponseCountChecker(collector, rule);
filter.check();
assertTrue(filter.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class SlowCountCheckerTest 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.SLOW_COUNT.getName(), 74, "testGroup", false, false, "");
SlowCountChecker checker = new SlowCountChecker(collector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class SlowCountToCalleCheckerTest 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.SLOW_COUNT_TO_CALLEE.getName(), 9, "testGroup", false, false, TO_SERVICE_NAME + 2);
SlowCountToCalleeChecker checker = new SlowCountToCalleeChecker(dataCollector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class SlowCountToCalleCheckerTest 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.SLOW_COUNT_TO_CALLEE.getName(), 7, "testGroup", false, false, TO_SERVICE_NAME + 1);
SlowCountToCalleeChecker checker = new SlowCountToCalleeChecker(dataCollector, rule);
checker.check();
assertTrue(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.
the class SlowRateCheckerTest method checkTest2.
/*
* not satisfied with alert condition
*/
@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.SLOW_RATE.getName(), 61, "testGroup", false, false, "");
SlowRateChecker filter = new SlowRateChecker(collector, rule);
filter.check();
assertFalse(filter.isDetected());
}
Aggregations