Search in sources :

Example 1 with SlowRateToCalleeChecker

use of com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker in project pinpoint by naver.

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

Example 2 with SlowRateToCalleeChecker

use of com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker 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 3 with SlowRateToCalleeChecker

use of com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker 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)

Aggregations

SlowRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.SlowRateToCalleeChecker)3 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)3 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)3 Application (com.navercorp.pinpoint.web.vo.Application)3 Test (org.junit.Test)3