Search in sources :

Example 1 with AgentStatDataCollector

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

the class HeapUsageRateCheckerTest method checkTest1.

@Test
public void checkTest1() {
    Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.HEAP_USAGE_RATE.getName(), 70, "testGroup", false, false, "");
    Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
    AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
    AgentChecker checker = new HeapUsageRateChecker(collector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : AgentStatDataCollector(com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 2 with AgentStatDataCollector

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

the class JvmCpuUsageRateCheckerTest method checkTest1.

@Test
public void checkTest1() {
    Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.JVM_CPU_USAGE_RATE.getName(), 60, "testGroup", false, false, "");
    Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
    AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
    AgentChecker checker = new JvmCpuUsageRateChecker(collector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : AgentStatDataCollector(com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 3 with AgentStatDataCollector

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

the class JvmCpuUsageRateCheckerTest method checkTest2.

@Test
public void checkTest2() {
    Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.JVM_CPU_USAGE_RATE.getName(), 61, "testGroup", false, false, "");
    Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
    AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
    AgentChecker checker = new JvmCpuUsageRateChecker(collector, rule);
    checker.check();
    assertFalse(checker.isDetected());
}
Also used : AgentStatDataCollector(com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 4 with AgentStatDataCollector

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

the class HeapUsageRateCheckerTest method checkTest2.

@Test
public void checkTest2() {
    Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.HEAP_USAGE_RATE.getName(), 71, "testGroup", false, false, "");
    Application application = new Application(SERVICE_NAME, ServiceType.STAND_ALONE);
    AgentStatDataCollector collector = new AgentStatDataCollector(DataCollectorCategory.AGENT_STAT, application, jvmGcDao, cpuLoadDao, applicationIndexDao, System.currentTimeMillis(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
    AgentChecker checker = new HeapUsageRateChecker(collector, rule);
    checker.check();
    assertFalse(checker.isDetected());
}
Also used : AgentStatDataCollector(com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)4 Application (com.navercorp.pinpoint.web.vo.Application)4 Test (org.junit.Test)4