Search in sources :

Example 56 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class ErrorRateCheckerTest method checkTest1.

/*
     * alert conditions not satisfied
     */
@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.ERROR_RATE.getName(), 60, "testGroup", false, false, "");
    ErrorRateChecker filter = new ErrorRateChecker(collector, rule);
    filter.check();
    assertTrue(filter.isDetected());
}
Also used : ErrorRateChecker(com.navercorp.pinpoint.web.alarm.checker.ErrorRateChecker) 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 57 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class ErrorRateToCalleCheckerTest 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_RATE_TO_CALLEE.getName(), 50, "testGroup", false, false, TO_SERVICE_NAME + 2);
    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 58 with Application

use of com.navercorp.pinpoint.web.vo.Application 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)

Example 59 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class LinkListTest method testFindFromLink.

@Test
public void testFindFromLink() throws Exception {
    Link tomcatToBlocLink = createTomcatToBlocLink();
    LinkList list = new LinkList();
    list.addLink(tomcatToBlocLink);
    Link tomcatToTomcatLink = createTomcatToTomcatLink();
    list.addLink(tomcatToTomcatLink);
    // find all links for "from" to request
    Application tomcat = new Application("from", TOMCAT);
    List<Link> findFromLink = list.findFromLink(tomcat);
    Assert.assertEquals(findFromLink.size(), 2);
    for (Link link : findFromLink) {
        Application linkFrom = link.getFrom().getApplication();
        Assert.assertTrue(linkFrom.equals(tomcat));
    }
    List<Link> unknown = list.findFromLink(new Application("unknown", TOMCAT));
    Assert.assertEquals(unknown.size(), 0);
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 60 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class LinkListTest method createTomcatToBlocLink.

private Link createTomcatToBlocLink() {
    LinkList linkList = new LinkList();
    Node from = new Node(new Application("from", TOMCAT));
    Node to = new Node(new Application("to", BLOC));
    Link link = new Link(CreateType.Source, from, to, new Range(0, 0));
    return link;
}
Also used : Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application)

Aggregations

Application (com.navercorp.pinpoint.web.vo.Application)90 Test (org.junit.Test)39 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)10 Range (com.navercorp.pinpoint.web.vo.Range)10 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 List (java.util.List)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 ArrayList (java.util.ArrayList)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3