Search in sources :

Example 31 with Rule

use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.

the class SlowRateCheckerTest method checkTest1.

/*
     * not satisfied with alert condition
     */
@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_RATE.getName(), 60, "testGroup", false, false, "");
    SlowRateChecker filter = new SlowRateChecker(collector, rule);
    filter.check();
    assertTrue(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)

Example 32 with Rule

use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.

the class SlowRateToCalleCheckerTest 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_RATE_TO_CALLEE.getName(), 90, "testGroup", false, false, TO_SERVICE_NAME + 2);
    SlowRateToCalleeChecker checker = new SlowRateToCalleeChecker(dataCollector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) SlowRateToCalleeChecker(com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker) Test(org.junit.Test)

Example 33 with Rule

use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.

the class SlowRateToCalleCheckerTest 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_RATE_TO_CALLEE.getName(), 70, "testGroup", false, false, TO_SERVICE_NAME + 1);
    SlowRateToCalleeChecker checker = new SlowRateToCalleeChecker(dataCollector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) SlowRateToCalleeChecker(com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker) Test(org.junit.Test)

Example 34 with Rule

use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.

the class TotalCountToCalleeCheckerTest 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.TOTAL_COUNT_TO_CALLEE.getName(), 10, "testGroup", false, false, TO_SERVICE_NAME + 1);
    TotalCountToCalleeChecker checker = new TotalCountToCalleeChecker(dataCollector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 35 with Rule

use of com.navercorp.pinpoint.web.alarm.vo.Rule in project pinpoint by naver.

the class TotalCountToCalleeCheckerTest method checkTest2.

@Test
public void checkTest2() {
    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.TOTAL_COUNT_TO_CALLEE.getName(), 11, "testGroup", false, false, TO_SERVICE_NAME + 1);
    TotalCountToCalleeChecker checker = new TotalCountToCalleeChecker(dataCollector, rule);
    checker.check();
    assertFalse(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)36 Test (org.junit.Test)33 Application (com.navercorp.pinpoint.web.vo.Application)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 SlowCountChecker (com.navercorp.pinpoint.web.alarm.checker.SlowCountChecker)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 LinkedList (java.util.LinkedList)4 AlarmChecker (com.navercorp.pinpoint.web.alarm.checker.AlarmChecker)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3 SlowRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker)3 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 SlowRateChecker (com.navercorp.pinpoint.web.alarm.checker.SlowRateChecker)2 DataCollector (com.navercorp.pinpoint.web.alarm.collector.DataCollector)2 AlarmServiceImpl (com.navercorp.pinpoint.web.service.AlarmServiceImpl)2 HashMap (java.util.HashMap)2 Ignore (org.junit.Ignore)2