use of com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory 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);
}
use of com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory 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;
}
use of com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory 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;
}
use of com.navercorp.pinpoint.web.applicationmap.appender.histogram.DefaultNodeHistogramFactory 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);
}
Aggregations