Search in sources :

Example 61 with Application

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

the class LinkListTest method testFindToLink.

@Test
public void testFindToLink() throws Exception {
    Link tomcatToBlocLink = createTomcatToBlocLink();
    LinkList list = new LinkList();
    list.addLink(tomcatToBlocLink);
    Link tomcatToTomcatLink = createTomcatToTomcatLink();
    list.addLink(tomcatToTomcatLink);
    // find all links requesting "to"
    Application toBloc = new Application("to", BLOC);
    List<Link> findToLink = list.findToLink(toBloc);
    Assert.assertEquals(findToLink.size(), 1);
    for (Link link : findToLink) {
        Application to = link.getTo().getApplication();
        Assert.assertTrue(toBloc + " " + to, toBloc.equals(to));
    }
    List<Link> unknown = list.findToLink(new Application("unknown", BLOC));
    Assert.assertEquals(unknown.size(), 0);
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 62 with Application

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

the class LinkListTest method createTomcatToTomcatLink.

private Link createTomcatToTomcatLink() {
    LinkList linkList = new LinkList();
    Node from = new Node(new Application("from", TOMCAT));
    Node to = new Node(new Application("to", TOMCAT));
    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)

Example 63 with Application

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

the class ApplicationTimeHistogramTest method testViewModel.

@Test
public void testViewModel() throws IOException {
    Application app = new Application("test", ServiceType.STAND_ALONE);
    ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(app, new Range(0, 10 * 6000));
    List<ResponseTime> responseHistogramList = createResponseTime(app);
    ApplicationTimeHistogram histogram = builder.build(responseHistogramList);
    List<ResponseTimeViewModel> viewModel = histogram.createViewModel();
    logger.debug("{}", viewModel);
    ObjectWriter writer = mapper.writer();
    String s = writer.writeValueAsString(viewModel);
    logger.debug(s);
}
Also used : ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) ResponseTimeViewModel(com.navercorp.pinpoint.web.view.ResponseTimeViewModel) ObjectWriter(com.fasterxml.jackson.databind.ObjectWriter) ResponseTime(com.navercorp.pinpoint.web.vo.ResponseTime) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 64 with Application

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

the class ResponseCountCheckerTest method checkTest2.

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

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

the class ResponseCountCheckerTest 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(), DataCollectorFactory.SLOT_INTERVAL_FIVE_MIN);
    Rule rule = new Rule(SERVICE_NAME, SERVICE_TYPE, CheckerCategory.TOTAL_COUNT.getName(), 125, "testGroup", false, false, "");
    ResponseCountChecker filter = new ResponseCountChecker(collector, rule);
    filter.check();
    assertTrue(filter.isDetected());
}
Also used : ResponseCountChecker(com.navercorp.pinpoint.web.alarm.checker.ResponseCountChecker) 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

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