Search in sources :

Example 1 with MapStatisticsCallerDataCollector

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

Example 2 with MapStatisticsCallerDataCollector

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

Example 3 with MapStatisticsCallerDataCollector

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

the class ErrorRateToCalleCheckerTest 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.ERROR_RATE_TO_CALLEE.getName(), 51, "testGroup", false, false, TO_SERVICE_NAME + 1);
    ErrorRateToCalleeChecker checker = new ErrorRateToCalleeChecker(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) ErrorRateToCalleeChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker) Test(org.junit.Test)

Example 4 with MapStatisticsCallerDataCollector

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

the class ErrorRateToCalleCheckerTest 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_RATE_TO_CALLEE.getName(), 50, "testGroup", false, false, TO_SERVICE_NAME + 1);
    ErrorRateToCalleeChecker checker = new ErrorRateToCalleeChecker(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) ErrorRateToCalleeChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker) Test(org.junit.Test)

Example 5 with MapStatisticsCallerDataCollector

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

the class SlowCountToCalleCheckerTest 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.SLOW_COUNT_TO_CALLEE.getName(), 8, "testGroup", false, false, TO_SERVICE_NAME + 1);
    SlowCountToCalleeChecker checker = new SlowCountToCalleeChecker(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

MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)15 Application (com.navercorp.pinpoint.web.vo.Application)15 Test (org.junit.Test)15 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