Search in sources :

Example 6 with ResponseTimeDataCollector

use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.

the class ErrorRateCheckerTest 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_RATE.getName(), 60, "testGroup", false, false, "");
    ErrorRateChecker filter = new ErrorRateChecker(collector, rule);
    filter.check();
    assertTrue(filter.isDetected());
}
Also used : ErrorRateChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorRateChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Example 7 with ResponseTimeDataCollector

use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector in project pinpoint by naver.

the class ResponseCountCheckerTest 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.TOTAL_COUNT.getName(), 126, "testGroup", false, false, "");
    ResponseCountChecker filter = new ResponseCountChecker(collector, rule);
    filter.check();
    assertFalse(filter.isDetected());
}
Also used : ResponseCountChecker(com.navercorp.pinpoint.web.alarm.checker.ResponseCountChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Example 8 with ResponseTimeDataCollector

use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector 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());
}
Also used : ResponseCountChecker(com.navercorp.pinpoint.web.alarm.checker.ResponseCountChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Example 9 with ResponseTimeDataCollector

use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector 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());
}
Also used : SlowCountChecker(com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Example 10 with ResponseTimeDataCollector

use of com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector 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());
}
Also used : SlowRateChecker(com.navercorp.pinpoint.web.alarm.checker.SlowRateChecker) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) ResponseTimeDataCollector(com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector) Test(org.junit.Test)

Aggregations

ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)11 Application (com.navercorp.pinpoint.web.vo.Application)11 Test (org.junit.Test)10 ErrorCountChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountChecker)2 ErrorRateChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateChecker)2 ResponseCountChecker (com.navercorp.pinpoint.web.alarm.checker.ResponseCountChecker)2 SlowCountChecker (com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker)2 SlowRateChecker (com.navercorp.pinpoint.web.alarm.checker.SlowRateChecker)2 DataCollector (com.navercorp.pinpoint.web.alarm.collector.DataCollector)1 ApplicationIndexDao (com.navercorp.pinpoint.web.dao.ApplicationIndexDao)1 AlarmServiceImpl (com.navercorp.pinpoint.web.service.AlarmServiceImpl)1 HashMap (java.util.HashMap)1 LinkedList (java.util.LinkedList)1 List (java.util.List)1 BeforeClass (org.junit.BeforeClass)1