Search in sources :

Example 1 with DefaultServerInstanceListFactory

use of com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory in project pinpoint by naver.

the class ApplicationMapBuilderTest method runTest.

private void runTest(int callerDepth, int calleeDepth) {
    Range range = Range.newRange(0, 1000);
    int expectedNumNodes = ApplicationMapBuilderTestHelper.getExpectedNumNodes(calleeDepth, callerDepth);
    int expectedNumLinks = ApplicationMapBuilderTestHelper.getExpectedNumLinks(calleeDepth, callerDepth);
    NodeHistogramFactory nodeHistogramFactory_MapResponseDao = new DefaultNodeHistogramFactory(mapResponseNodeHistogramDataSource);
    NodeHistogramFactory nodeHistogramFactory_ResponseHistogramBuilder = new DefaultNodeHistogramFactory(responseHistogramBuilderNodeHistogramDataSource);
    ServerInstanceListFactory serverInstanceListFactory = new DefaultServerInstanceListFactory(agentInfoServerInstanceListDataSource);
    LinkDataDuplexMap linkDataDuplexMap = ApplicationMapBuilderTestHelper.createLinkDataDuplexMap(calleeDepth, callerDepth);
    ApplicationMapBuilder applicationMapBuilder = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, serialExecutor);
    ApplicationMapBuilder applicationMapBuilder_parallelAppenders = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, parallelExecutor);
    // test builder using MapResponseDao
    ApplicationMap applicationMap_MapResponseDao = applicationMapBuilder.includeNodeHistogram(nodeHistogramFactory_MapResponseDao).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    ApplicationMap applicationMap_MapResponseDao_parallelAppenders = applicationMapBuilder_parallelAppenders.includeNodeHistogram(nodeHistogramFactory_MapResponseDao).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    Assert.assertEquals(expectedNumNodes, applicationMap_MapResponseDao.getNodes().size());
    Assert.assertEquals(expectedNumNodes, applicationMap_MapResponseDao_parallelAppenders.getNodes().size());
    Assert.assertEquals(expectedNumLinks, applicationMap_MapResponseDao.getLinks().size());
    Assert.assertEquals(expectedNumLinks, applicationMap_MapResponseDao_parallelAppenders.getLinks().size());
    ApplicationMapVerifier verifier_MapResponseDao = new ApplicationMapVerifier(applicationMap_MapResponseDao);
    verifier_MapResponseDao.verify(applicationMap_MapResponseDao);
    verifier_MapResponseDao.verify(applicationMap_MapResponseDao_parallelAppenders);
    // test builder using ResponseHistogramBuilder
    ApplicationMap applicationMap_ResponseHistogramBuilder = applicationMapBuilder.includeNodeHistogram(nodeHistogramFactory_ResponseHistogramBuilder).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    ApplicationMap applicationMap_ResponseHistogramBuilder_parallelAppenders = applicationMapBuilder_parallelAppenders.includeNodeHistogram(nodeHistogramFactory_ResponseHistogramBuilder).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    Assert.assertEquals(expectedNumNodes, applicationMap_ResponseHistogramBuilder.getNodes().size());
    Assert.assertEquals(expectedNumNodes, applicationMap_ResponseHistogramBuilder_parallelAppenders.getNodes().size());
    Assert.assertEquals(expectedNumLinks, applicationMap_ResponseHistogramBuilder.getLinks().size());
    Assert.assertEquals(expectedNumLinks, applicationMap_ResponseHistogramBuilder_parallelAppenders.getLinks().size());
    ApplicationMapVerifier verifier_ResponseHistogramBuilder = new ApplicationMapVerifier(applicationMap_ResponseHistogramBuilder);
    verifier_ResponseHistogramBuilder.verify(applicationMap_ResponseHistogramBuilder);
    verifier_ResponseHistogramBuilder.verify(applicationMap_ResponseHistogramBuilder_parallelAppenders);
}
Also used : DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) ServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) NodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)

Example 2 with DefaultServerInstanceListFactory

use of com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory in project pinpoint by naver.

the class FilteredMapServiceImpl method createMap.

private ApplicationMap createMap(FilteredMapServiceOption option, FilteredMap filteredMap) {
    final ApplicationMapBuilder applicationMapBuilder = applicationMapBuilderFactory.createApplicationMapBuilder(option.getOriginalRange());
    applicationMapBuilder.linkType(LinkType.DETAILED);
    final WasNodeHistogramDataSource wasNodeHistogramDataSource = new ResponseHistogramsNodeHistogramDataSource(filteredMap.getResponseHistograms());
    applicationMapBuilder.includeNodeHistogram(new DefaultNodeHistogramFactory(wasNodeHistogramDataSource));
    ServerInstanceListDataSource serverInstanceListDataSource = new AgentInfoServerInstanceListDataSource(agentInfoService);
    if (option.isUseStatisticsAgentState()) {
        applicationMapBuilder.includeServerInfo(new StatisticsServerInstanceListFactory(serverInstanceListDataSource));
    } else {
        applicationMapBuilder.includeServerInfo(new DefaultServerInstanceListFactory(serverInstanceListDataSource));
    }
    ApplicationMap map = applicationMapBuilder.build(filteredMap.getLinkDataDuplexMap(), buildTimeoutMillis);
    if (serverMapDataFilter != null) {
        map = serverMapDataFilter.dataFiltering(map);
    }
    return map;
}
Also used : AgentInfoServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.AgentInfoServerInstanceListDataSource) DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) ApplicationMap(com.navercorp.pinpoint.web.applicationmap.ApplicationMap) StatisticsServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.StatisticsServerInstanceListFactory) ServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.ServerInstanceListDataSource) AgentInfoServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.AgentInfoServerInstanceListDataSource) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) WasNodeHistogramDataSource(com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.WasNodeHistogramDataSource) ResponseHistogramsNodeHistogramDataSource(com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.ResponseHistogramsNodeHistogramDataSource) ApplicationMapBuilder(com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)

Example 3 with DefaultServerInstanceListFactory

use of com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory in project pinpoint by naver.

the class MapServiceImpl method createApplicationMapBuilder.

private ApplicationMapBuilder createApplicationMapBuilder(MapServiceOption option) {
    ApplicationMapBuilder builder = applicationMapBuilderFactory.createApplicationMapBuilder(option.getRange());
    builder.nodeType(option.getNodeType());
    builder.linkType(option.getLinkType());
    WasNodeHistogramDataSource wasNodeHistogramDataSource = new MapResponseNodeHistogramDataSource(mapResponseDao);
    NodeHistogramFactory nodeHistogramFactory = new DefaultNodeHistogramFactory(wasNodeHistogramDataSource);
    builder.includeNodeHistogram(nodeHistogramFactory);
    ServerInstanceListDataSource serverInstanceListDataSource = new AgentInfoServerInstanceListDataSource(agentInfoService);
    if (option.isUseStatisticsAgentState()) {
        builder.includeServerInfo(new StatisticsServerInstanceListFactory(serverInstanceListDataSource));
    } else {
        builder.includeServerInfo(new DefaultServerInstanceListFactory(serverInstanceListDataSource));
    }
    return builder;
}
Also used : AgentInfoServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.AgentInfoServerInstanceListDataSource) DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) StatisticsServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.StatisticsServerInstanceListFactory) ServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.ServerInstanceListDataSource) AgentInfoServerInstanceListDataSource(com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.AgentInfoServerInstanceListDataSource) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) WasNodeHistogramDataSource(com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.WasNodeHistogramDataSource) MapResponseNodeHistogramDataSource(com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.MapResponseNodeHistogramDataSource) ApplicationMapBuilder(com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder) DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) NodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)

Example 4 with DefaultServerInstanceListFactory

use of com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory in project pinpoint by naver.

the class ApplicationMapBuilderTest method testEmptyCallData.

@Test
public void testEmptyCallData() {
    Range range = Range.newRange(0, 1000);
    LinkDataDuplexMap linkDataDuplexMap = new LinkDataDuplexMap();
    NodeHistogramFactory nodeHistogramFactory = new DefaultNodeHistogramFactory(mapResponseNodeHistogramDataSource);
    ServerInstanceListFactory serverInstanceListFactory = new DefaultServerInstanceListFactory(agentInfoServerInstanceListDataSource);
    ApplicationMapBuilder applicationMapBuilder = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, serialExecutor);
    ApplicationMapBuilder applicationMapBuilder_parallelAppenders = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, parallelExecutor);
    ApplicationMap applicationMap = applicationMapBuilder.includeNodeHistogram(nodeHistogramFactory).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    ApplicationMap applicationMap_parallelAppenders = applicationMapBuilder_parallelAppenders.includeNodeHistogram(nodeHistogramFactory).includeServerInfo(serverInstanceListFactory).build(linkDataDuplexMap, buildTimeoutMillis);
    Assert.assertTrue(applicationMap.getNodes().isEmpty());
    Assert.assertTrue(applicationMap.getNodes().isEmpty());
    Assert.assertTrue(applicationMap_parallelAppenders.getNodes().isEmpty());
    Assert.assertTrue(applicationMap.getLinks().isEmpty());
    Assert.assertTrue(applicationMap.getLinks().isEmpty());
    Assert.assertTrue(applicationMap_parallelAppenders.getLinks().isEmpty());
    ApplicationMapVerifier verifier = new ApplicationMapVerifier(applicationMap);
    verifier.verify(applicationMap);
    verifier.verify(applicationMap_parallelAppenders);
}
Also used : DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) ServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) Range(com.navercorp.pinpoint.web.vo.Range) DefaultNodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory) NodeHistogramFactory(com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory) Test(org.junit.Test)

Example 5 with DefaultServerInstanceListFactory

use of com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory in project pinpoint by naver.

the class ApplicationMapBuilderTest method testNoCallData.

@Test
public void testNoCallData() {
    Range range = Range.newRange(0, 1000);
    Application application = ApplicationMapBuilderTestHelper.createApplicationFromDepth(0);
    ServerInstanceListFactory serverInstanceListFactory = new DefaultServerInstanceListFactory(agentInfoServerInstanceListDataSource);
    ApplicationMapBuilder applicationMapBuilder = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, serialExecutor);
    ApplicationMapBuilder applicationMapBuilder_parallelAppenders = ApplicationMapBuilderTestHelper.createApplicationMapBuilder(range, parallelExecutor);
    ApplicationMap applicationMap = applicationMapBuilder.includeServerInfo(serverInstanceListFactory).build(application, buildTimeoutMillis);
    ApplicationMap applicationMap_parallelAppenders = applicationMapBuilder_parallelAppenders.includeServerInfo(serverInstanceListFactory).build(application, buildTimeoutMillis);
    Assert.assertEquals(1, applicationMap.getNodes().size());
    Assert.assertEquals(1, applicationMap.getNodes().size());
    Assert.assertEquals(1, applicationMap_parallelAppenders.getNodes().size());
    Assert.assertEquals(0, applicationMap.getLinks().size());
    Assert.assertEquals(0, applicationMap.getLinks().size());
    Assert.assertEquals(0, applicationMap_parallelAppenders.getLinks().size());
    ApplicationMapVerifier verifier = new ApplicationMapVerifier(applicationMap);
    verifier.verify(applicationMap);
    verifier.verify(applicationMap_parallelAppenders);
}
Also used : ServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) DefaultServerInstanceListFactory(com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) Test(org.junit.Test)

Aggregations

DefaultServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.DefaultServerInstanceListFactory)5 DefaultNodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory)4 NodeHistogramFactory (com.navercorp.pinpoint.web.applicationmap.appender.histogram.NodeHistogramFactory)3 ServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.ServerInstanceListFactory)3 Range (com.navercorp.pinpoint.web.vo.Range)3 ApplicationMapBuilder (com.navercorp.pinpoint.web.applicationmap.ApplicationMapBuilder)2 WasNodeHistogramDataSource (com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.WasNodeHistogramDataSource)2 StatisticsServerInstanceListFactory (com.navercorp.pinpoint.web.applicationmap.appender.server.StatisticsServerInstanceListFactory)2 AgentInfoServerInstanceListDataSource (com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.AgentInfoServerInstanceListDataSource)2 ServerInstanceListDataSource (com.navercorp.pinpoint.web.applicationmap.appender.server.datasource.ServerInstanceListDataSource)2 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)2 Test (org.junit.Test)2 ApplicationMap (com.navercorp.pinpoint.web.applicationmap.ApplicationMap)1 MapResponseNodeHistogramDataSource (com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.MapResponseNodeHistogramDataSource)1 ResponseHistogramsNodeHistogramDataSource (com.navercorp.pinpoint.web.applicationmap.appender.histogram.datasource.ResponseHistogramsNodeHistogramDataSource)1 Application (com.navercorp.pinpoint.web.vo.Application)1