Search in sources :

Example 6 with NodeList

use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList 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 7 with NodeList

use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList 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 8 with NodeList

use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList 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)

Example 9 with NodeList

use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.

the class ServerInfoAppenderTest method unknownNode.

@Test
public void unknownNode() {
    // Given
    Range range = Range.newRange(0, 60 * 1000);
    NodeList nodeList = new NodeList();
    LinkDataDuplexMap linkDataDuplexMap = mock(LinkDataDuplexMap.class);
    Node unknownNode = new Node(new Application("Unknown", ServiceType.UNKNOWN));
    nodeList.addNode(unknownNode);
    // When
    serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutMillis);
    // Then
    Assert.assertEquals(0, unknownNode.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 10 with NodeList

use of com.navercorp.pinpoint.web.applicationmap.nodes.NodeList in project pinpoint by naver.

the class ApplicationMapTest method root.

@Test
public void root() throws IOException {
    ApplicationMap app = new DefaultApplicationMap(Range.newRange(0, 1), new NodeList(), new LinkList());
    String s = MAPPER.writeValueAsString(app);
    logger.debug(s);
}
Also used : NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) Test(org.junit.Test)

Aggregations

NodeList (com.navercorp.pinpoint.web.applicationmap.nodes.NodeList)19 Test (org.junit.Test)15 Range (com.navercorp.pinpoint.web.vo.Range)14 Node (com.navercorp.pinpoint.web.applicationmap.nodes.Node)13 LinkList (com.navercorp.pinpoint.web.applicationmap.link.LinkList)11 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)10 Application (com.navercorp.pinpoint.web.vo.Application)7 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)6 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)5 HistogramSlot (com.navercorp.pinpoint.common.trace.HistogramSlot)4 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)4 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)4 ServerInstanceList (com.navercorp.pinpoint.web.applicationmap.nodes.ServerInstanceList)4 NodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)3 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)3 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 LinkSelector (com.navercorp.pinpoint.web.service.map.LinkSelector)2