use of com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker 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.checker.SlowCountChecker in project pinpoint by naver.
the class SlowCountCheckerTest 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.SLOW_COUNT.getName(), 76, "testGroup", false, false, "");
SlowCountChecker checker = new SlowCountChecker(collector, rule);
checker.check();
assertFalse(checker.isDetected());
}
use of com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker in project pinpoint by naver.
the class CheckerCategoryTest method createCheckerTest.
@Test
public void createCheckerTest() {
CheckerCategory slowCount = CheckerCategory.getValue("slow count");
Rule rule = new Rule(null, "", CheckerCategory.SLOW_COUNT.getName(), 75, "testGroup", false, false, "");
SlowCountChecker checker = (SlowCountChecker) slowCount.createChecker(null, rule);
rule = new Rule(null, "", CheckerCategory.SLOW_COUNT.getName(), 63, "testGroup", false, false, "");
SlowCountChecker checker2 = (SlowCountChecker) slowCount.createChecker(null, rule);
assertNotSame(checker, checker2);
assertNotNull(checker);
assertEquals(75, (int) checker.getRule().getThreshold());
assertNotNull(checker2);
assertEquals(63, (int) checker2.getRule().getThreshold());
}
use of com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker in project pinpoint by naver.
the class WriterTest method smsSendTest.
@Ignore
@Test
public void smsSendTest() throws Exception {
Rule rule = new Rule("testService", "tomcat", CheckerCategory.SLOW_COUNT.getName(), 100, "testGroup", true, false, "");
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.checker.SlowCountChecker 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());
}
Aggregations