Search in sources :

Example 6 with LinkDataDuplexMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.

the class ApplicationMapBuilderTestHelper method createLinkDataDuplexMap.

public static LinkDataDuplexMap createLinkDataDuplexMap(int calleeDepth, int callerDepth) {
    if (calleeDepth < 1) {
        throw new IllegalArgumentException("calleeDepth must be greater than 0");
    }
    if (callerDepth < 1) {
        throw new IllegalArgumentException("callerDepth must be greater than 0");
    }
    LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
    for (int i = 0; i < calleeDepth - 1; i++) {
        LinkData targetLinkData = createTargetLinkData(i);
        linkDataDuplexMap.addTargetLinkData(targetLinkData);
    }
    linkDataDuplexMap.addTargetLinkData(createUserTargetLinkData(calleeDepth - 1));
    linkDataDuplexMap.addSourceLinkData(createTerminalSourceLinkData(0));
    for (int i = 0; i < callerDepth - 1; i++) {
        LinkData sourceLinkData = createSourceLinkData(i);
        linkDataDuplexMap.addSourceLinkData(sourceLinkData);
    }
    linkDataDuplexMap.addSourceLinkData(createUnknownSourceLinkData(callerDepth - 1));
    return linkDataDuplexMap;
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)

Example 7 with LinkDataDuplexMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.

the class ServerInfoAppenderTest method emptyNodeList.

@Test
public void emptyNodeList() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
    // When
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
    // Then
    Assert.assertTrue(nodeList.getNodeList().isEmpty());
    verifyZeroInteractions(serverInstanceListDataSource);
    verifyZeroInteractions(linkDataDuplexMap);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) Test(org.junit.Test)

Example 8 with LinkDataDuplexMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.

the class ServerInfoAppenderTest method userNode.

@Test
public void userNode() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
    Node userNode = new Node(new Application("User", ServiceType.USER));
    nodeList.addNode(userNode);
    // When
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
    // Then
    Assert.assertEquals(0, userNode.getServerInstanceList().getInstanceCount());
    verifyZeroInteractions(linkDataDuplexMap);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) Node(com.navercorp.pinpoint.web.applicationmap.nodes.Node) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 9 with LinkDataDuplexMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.

the class ServerInfoAppenderTest method wasNode.

@Test
public void wasNode() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
    Node wasNode = new Node(new Application("Was", ServiceType.TEST_STAND_ALONE));
    nodeList.addNode(wasNode);
    ServerInstanceList serverInstanceList = new ServerInstanceList();
    when(serverInstanceListDataSource.createServerInstanceList(wasNode, range.getTo())).thenReturn(serverInstanceList);
    // When
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
    // Then
    Assert.assertSame(serverInstanceList, wasNode.getServerInstanceList());
    verifyZeroInteractions(linkDataDuplexMap);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) Node(com.navercorp.pinpoint.web.applicationmap.nodes.Node) ServerInstanceList(com.navercorp.pinpoint.web.applicationmap.nodes.ServerInstanceList) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Example 10 with LinkDataDuplexMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap in project pinpoint by naver.

the class ServerInfoAppenderTest method wasNodes.

@Test
public void wasNodes() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
    Node wasNode1 = new Node(new Application("Was1", ServiceType.TEST_STAND_ALONE));
    nodeList.addNode(wasNode1);
    Node wasNode2 = new Node(new Application("Was2", ServiceType.TEST_STAND_ALONE));
    nodeList.addNode(wasNode2);
    ServerInstanceList serverInstanceList1 = new ServerInstanceList();
    when(serverInstanceListDataSource.createServerInstanceList(wasNode1, range.getTo())).thenReturn(serverInstanceList1);
    ServerInstanceList serverInstanceList2 = new ServerInstanceList();
    when(serverInstanceListDataSource.createServerInstanceList(wasNode2, range.getTo())).thenReturn(serverInstanceList2);
    // When
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
    // Then
    Assert.assertSame(serverInstanceList1, wasNode1.getServerInstanceList());
    Assert.assertSame(serverInstanceList2, wasNode2.getServerInstanceList());
    verifyZeroInteractions(linkDataDuplexMap);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) Node(com.navercorp.pinpoint.web.applicationmap.nodes.Node) ServerInstanceList(com.navercorp.pinpoint.web.applicationmap.nodes.ServerInstanceList) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)35 Application (com.navercorp.pinpoint.web.vo.Application)26 Range (com.navercorp.pinpoint.web.vo.Range)24 Test (org.junit.Test)22 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)15 NodeList (com.navercorp.pinpoint.web.applicationmap.nodes.NodeList)10 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)10 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)9 Node (com.navercorp.pinpoint.web.applicationmap.nodes.Node)7 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)4 ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)3 ApplicationMapBuilder (com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)3 DefaultNodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory)3 NodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)3 DefaultServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory)3 ServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory)3 ServerInstanceList (com.navercorp.pinpoint.web.applicationmap.nodes.ServerInstanceList)3 LinkSelector (com.navercorp.pinpoint.web.service.map.LinkSelector)3 LinkDataMapProcessor (com.navercorp.pinpoint.web.service.map.processor.LinkDataMapProcessor)3 ArrayList (java.util.ArrayList)3