Search in sources :

Example 11 with LinkList

use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.

the class LinkListTest method testFindToLink.

@Test
public void testFindToLink() {
    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.assertEquals(toBloc + " " + to, toBloc, to);
    }
    List<Link> unknown = list.findToLink(new Application("unknown", BLOC));
    Assert.assertEquals(unknown.size(), 0);
}
Also used : LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Application(com.navercorp.pinpoint.web.vo.Application) Link(com.navercorp.pinpoint.web.applicationmap.link.Link) Test(org.junit.Test)

Example 12 with LinkList

use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.

the class NodeHistogramAppenderTest method emptyNodeList.

@Test
public void emptyNodeList() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkList linkList = new LinkList();
    // When
    nodeHistogramAppender.appendNodeHistogram(range, nodeList, linkList, buildTimeoutMillis);
    // Then
    Assert.assertTrue(nodeList.getNodeList().isEmpty());
    verifyZeroInteractions(wasNodeHistogramDataSource);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) Range(com.navercorp.pinpoint.web.vo.Range) LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Test(org.junit.Test)

Example 13 with LinkList

use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.

the class LinkListTest method testFindFromLink.

@Test
public void testFindFromLink() {
    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.assertEquals(linkFrom, tomcat);
    }
    List<Link> unknown = list.findFromLink(new Application("unknown", TOMCAT));
    Assert.assertEquals(unknown.size(), 0);
}
Also used : LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Application(com.navercorp.pinpoint.web.vo.Application) Link(com.navercorp.pinpoint.web.applicationmap.link.Link) Test(org.junit.Test)

Example 14 with LinkList

use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.

the class LinkListTest method addLinkList.

@Test
public void addLinkList() {
    Link tomcatToTomcatLink = createTomcatToTomcatLink();
    LinkList copy = new LinkList();
    copy.addLink(tomcatToTomcatLink);
    LinkList original = new LinkList();
    original.addLinkList(copy);
    Assert.assertEquals(original.size(), 1);
    // don't copy in case of duplicated node
    original.addLinkList(copy);
    Assert.assertEquals(original.size(), 1);
}
Also used : LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Link(com.navercorp.pinpoint.web.applicationmap.link.Link) Test(org.junit.Test)

Example 15 with LinkList

use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.

the class LinkListTest method testGetLinkList.

@Test
public void testGetLinkList() {
    LinkList linkList = new LinkList();
    Assert.assertEquals(linkList.getLinkList().size(), 0);
}
Also used : LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Test(org.junit.Test)

Aggregations

LinkList (com.navercorp.pinpoint.web.applicationmap.link.LinkList)20 Test (org.junit.Test)13 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)12 NodeList (com.navercorp.pinpoint.web.applicationmap.nodes.NodeList)11 Node (com.navercorp.pinpoint.web.applicationmap.nodes.Node)9 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)6 Range (com.navercorp.pinpoint.web.vo.Range)6 Application (com.navercorp.pinpoint.web.vo.Application)5 HistogramSlot (com.navercorp.pinpoint.common.trace.HistogramSlot)4 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)4 NodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)2 EmptyNodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.EmptyNodeHistogramFactory)2 NodeHistogramAppender (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramAppender)2 ServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory)2 NodeType (com.navercorp.pinpoint.web.applicationmap.nodes.NodeType)2 ServerInstanceList (com.navercorp.pinpoint.web.applicationmap.nodes.ServerInstanceList)2 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)2 LinkSelector (com.navercorp.pinpoint.web.service.map.LinkSelector)2 DestinationApplicationFilter (com.navercorp.pinpoint.web.service.map.processor.DestinationApplicationFilter)2