Search in sources :

Example 1 with SlowRateChecker

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

Example 2 with SlowRateChecker

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

Aggregations

SlowRateChecker (com.navercorp.pinpoint.web.alarm.checker.SlowRateChecker)2 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)2 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)2 Application (com.navercorp.pinpoint.web.vo.Application)2 Test (org.junit.Test)2