Search in sources :

Example 6 with MapStatisticsCallerDataCollector

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

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

Example 7 with MapStatisticsCallerDataCollector

use of com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector 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, false, TO_SERVICE_NAME + 1);
    TotalCountToCalleeChecker checker = new TotalCountToCalleeChecker(dataCollector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 8 with MapStatisticsCallerDataCollector

use of com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector 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, false, TO_SERVICE_NAME + 1);
    TotalCountToCalleeChecker checker = new TotalCountToCalleeChecker(dataCollector, rule);
    checker.check();
    assertFalse(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 9 with MapStatisticsCallerDataCollector

use of com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector in project pinpoint by pinpoint-apm.

the class CheckerRegistry method setup.

private void setup() {
    put(CheckerCategory.SLOW_COUNT, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new SlowCountChecker((ResponseTimeDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.SLOW_RATE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new SlowRateChecker((ResponseTimeDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.ERROR_COUNT, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new ErrorCountChecker((ResponseTimeDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.ERROR_RATE, new AlarmCheckerFactory() {

        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new ErrorRateChecker((ResponseTimeDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.TOTAL_COUNT, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new ResponseCountChecker((ResponseTimeDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.SLOW_COUNT_TO_CALLEE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new SlowCountToCalleeChecker((MapStatisticsCallerDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.SLOW_RATE_TO_CALLEE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new SlowRateToCalleeChecker(dataCollector, rule);
        }
    });
    put(CheckerCategory.ERROR_COUNT_TO_CALLEE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new ErrorCountToCalleeChecker((MapStatisticsCallerDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.ERROR_RATE_TO_CALLEE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new ErrorRateToCalleeChecker(dataCollector, rule);
        }
    });
    put(CheckerCategory.TOTAL_COUNT_TO_CALLEE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new TotalCountToCalleeChecker((MapStatisticsCallerDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.HEAP_USAGE_RATE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new HeapUsageRateChecker((AgentStatDataCollector) dataCollector, rule);
        }
    });
    // put(CheckerCategory.GC_COUNT, new AlarmCheckerFactory() {
    // @Override
    // public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
    // return new GcCountChecker((AgentStatDataCollector)dataCollector, rule);
    // }
    // });
    put(CheckerCategory.JVM_CPU_USAGE_RATE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new JvmCpuUsageRateChecker((AgentStatDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.SYSTEM_CPU_USAGE_RATE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new SystemCpuUsageRateChecker((AgentStatDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.DATASOURCE_CONNECTION_USAGE_RATE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new DataSourceConnectionUsageRateChecker((DataSourceDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.DEADLOCK_OCCURRENCE, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new DeadlockChecker((AgentEventDataCollector) dataCollector, rule);
        }
    });
    put(CheckerCategory.FILE_DESCRIPTOR_COUNT, new AlarmCheckerFactory() {

        @Override
        public AlarmChecker<?> createChecker(DataCollector dataCollector, Rule rule) {
            return new FileDescriptorChecker((FileDescriptorDataCollector) dataCollector, rule);
        }
    });
}
Also used : JvmCpuUsageRateChecker(com.navercorp.pinpoint.batch.alarm.checker.JvmCpuUsageRateChecker) SlowCountToCalleeChecker(com.navercorp.pinpoint.batch.alarm.checker.SlowCountToCalleeChecker) ResponseCountChecker(com.navercorp.pinpoint.batch.alarm.checker.ResponseCountChecker) MapStatisticsCallerDataCollector(com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector) DataSourceDataCollector(com.navercorp.pinpoint.batch.alarm.collector.DataSourceDataCollector) FileDescriptorDataCollector(com.navercorp.pinpoint.batch.alarm.collector.FileDescriptorDataCollector) ErrorRateToCalleeChecker(com.navercorp.pinpoint.batch.alarm.checker.ErrorRateToCalleeChecker) ResponseTimeDataCollector(com.navercorp.pinpoint.batch.alarm.collector.ResponseTimeDataCollector) SlowRateToCalleeChecker(com.navercorp.pinpoint.batch.alarm.checker.SlowRateToCalleeChecker) HeapUsageRateChecker(com.navercorp.pinpoint.batch.alarm.checker.HeapUsageRateChecker) FileDescriptorChecker(com.navercorp.pinpoint.batch.alarm.checker.FileDescriptorChecker) AgentStatDataCollector(com.navercorp.pinpoint.batch.alarm.collector.AgentStatDataCollector) SystemCpuUsageRateChecker(com.navercorp.pinpoint.batch.alarm.checker.SystemCpuUsageRateChecker) TotalCountToCalleeChecker(com.navercorp.pinpoint.batch.alarm.checker.TotalCountToCalleeChecker) SlowCountChecker(com.navercorp.pinpoint.batch.alarm.checker.SlowCountChecker) SlowRateChecker(com.navercorp.pinpoint.batch.alarm.checker.SlowRateChecker) AgentStatDataCollector(com.navercorp.pinpoint.batch.alarm.collector.AgentStatDataCollector) DataSourceDataCollector(com.navercorp.pinpoint.batch.alarm.collector.DataSourceDataCollector) MapStatisticsCallerDataCollector(com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector) ResponseTimeDataCollector(com.navercorp.pinpoint.batch.alarm.collector.ResponseTimeDataCollector) DataCollector(com.navercorp.pinpoint.batch.alarm.collector.DataCollector) AgentEventDataCollector(com.navercorp.pinpoint.batch.alarm.collector.AgentEventDataCollector) FileDescriptorDataCollector(com.navercorp.pinpoint.batch.alarm.collector.FileDescriptorDataCollector) DataSourceConnectionUsageRateChecker(com.navercorp.pinpoint.batch.alarm.checker.DataSourceConnectionUsageRateChecker) DeadlockChecker(com.navercorp.pinpoint.batch.alarm.checker.DeadlockChecker) ErrorRateChecker(com.navercorp.pinpoint.batch.alarm.checker.ErrorRateChecker) ErrorCountChecker(com.navercorp.pinpoint.batch.alarm.checker.ErrorCountChecker) ErrorCountToCalleeChecker(com.navercorp.pinpoint.batch.alarm.checker.ErrorCountToCalleeChecker) AgentEventDataCollector(com.navercorp.pinpoint.batch.alarm.collector.AgentEventDataCollector) Rule(com.navercorp.pinpoint.web.alarm.vo.Rule) AlarmChecker(com.navercorp.pinpoint.batch.alarm.checker.AlarmChecker)

Example 10 with MapStatisticsCallerDataCollector

use of com.navercorp.pinpoint.batch.alarm.collector.MapStatisticsCallerDataCollector in project pinpoint by pinpoint-apm.

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, false, TO_SERVICE_NAME + 1);
    ErrorRateToCalleeChecker checker = new ErrorRateToCalleeChecker(dataCollector, rule);
    checker.check();
    assertTrue(checker.isDetected());
}
Also used : MapStatisticsCallerDataCollector(com.navercorp.pinpoint.batch.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.batch.alarm.collector.MapStatisticsCallerDataCollector)32 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)32 Application (com.navercorp.pinpoint.web.vo.Application)30 Test (org.junit.Test)30 AlarmChecker (com.navercorp.pinpoint.batch.alarm.checker.AlarmChecker)2 DataSourceConnectionUsageRateChecker (com.navercorp.pinpoint.batch.alarm.checker.DataSourceConnectionUsageRateChecker)2 DeadlockChecker (com.navercorp.pinpoint.batch.alarm.checker.DeadlockChecker)2 ErrorCountChecker (com.navercorp.pinpoint.batch.alarm.checker.ErrorCountChecker)2 ErrorCountToCalleeChecker (com.navercorp.pinpoint.batch.alarm.checker.ErrorCountToCalleeChecker)2 ErrorRateChecker (com.navercorp.pinpoint.batch.alarm.checker.ErrorRateChecker)2 ErrorRateToCalleeChecker (com.navercorp.pinpoint.batch.alarm.checker.ErrorRateToCalleeChecker)2 FileDescriptorChecker (com.navercorp.pinpoint.batch.alarm.checker.FileDescriptorChecker)2 HeapUsageRateChecker (com.navercorp.pinpoint.batch.alarm.checker.HeapUsageRateChecker)2 JvmCpuUsageRateChecker (com.navercorp.pinpoint.batch.alarm.checker.JvmCpuUsageRateChecker)2 ResponseCountChecker (com.navercorp.pinpoint.batch.alarm.checker.ResponseCountChecker)2 SlowCountChecker (com.navercorp.pinpoint.batch.alarm.checker.SlowCountChecker)2 SlowCountToCalleeChecker (com.navercorp.pinpoint.batch.alarm.checker.SlowCountToCalleeChecker)2 SlowRateChecker (com.navercorp.pinpoint.batch.alarm.checker.SlowRateChecker)2 SlowRateToCalleeChecker (com.navercorp.pinpoint.batch.alarm.checker.SlowRateToCalleeChecker)2 SystemCpuUsageRateChecker (com.navercorp.pinpoint.batch.alarm.checker.SystemCpuUsageRateChecker)2