use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class ApplicationMapBuilder method build.
public ApplicationMap build(Application application, long timeoutMillis) {
logger.info("Building empty application map");
NodeList nodeList = new NodeList();
LinkList emptyLinkList = new LinkList();
NodeType nodeType = this.nodeType;
if (nodeType == null) {
nodeType = NodeType.DETAILED;
}
Node node = new Node(nodeType, application);
if (serverInstanceListFactory != null) {
ServerInstanceList runningInstances = serverInstanceListFactory.createWasNodeInstanceList(node, range.getTo());
if (runningInstances.getInstanceCount() > 0) {
node.setServerInstanceList(runningInstances);
nodeList.addNode(node);
}
}
NodeHistogramFactory nodeHistogramFactory = this.nodeHistogramFactory;
if (nodeHistogramFactory == null) {
nodeHistogramFactory = new EmptyNodeHistogramFactory();
}
NodeHistogramAppender nodeHistogramAppender = nodeHistogramAppenderFactory.create(nodeHistogramFactory);
nodeHistogramAppender.appendNodeHistogram(range, nodeList, emptyLinkList, timeoutMillis);
return new DefaultApplicationMap(range, nodeList, emptyLinkList);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class ApplicationMapBuilder method build.
public ApplicationMap build(LinkDataDuplexMap linkDataDuplexMap, long timeoutMillis) {
Objects.requireNonNull(linkDataDuplexMap, "linkDataDuplexMap");
logger.info("Building application map");
NodeType nodeType = this.nodeType;
if (nodeType == null) {
nodeType = NodeType.DETAILED;
}
LinkType linkType = this.linkType;
if (linkType == null) {
linkType = LinkType.DETAILED;
}
NodeList nodeList = NodeListFactory.createNodeList(nodeType, linkDataDuplexMap);
LinkList linkList = LinkListFactory.createLinkList(linkType, nodeList, linkDataDuplexMap, range);
NodeHistogramFactory nodeHistogramFactory = this.nodeHistogramFactory;
if (nodeHistogramFactory == null) {
nodeHistogramFactory = new EmptyNodeHistogramFactory();
}
NodeHistogramAppender nodeHistogramAppender = nodeHistogramAppenderFactory.create(nodeHistogramFactory);
final TimeoutWatcher timeoutWatcher = new TimeoutWatcher(timeoutMillis);
nodeHistogramAppender.appendNodeHistogram(range, nodeList, linkList, timeoutWatcher.remainingTimeMillis());
ServerInstanceListFactory serverInstanceListFactory = this.serverInstanceListFactory;
if (serverInstanceListFactory == null) {
serverInstanceListFactory = new EmptyServerInstanceListFactory();
}
ServerInfoAppender serverInfoAppender = serverInfoAppenderFactory.create(serverInstanceListFactory);
serverInfoAppender.appendServerInfo(range, nodeList, linkDataDuplexMap, timeoutWatcher.remainingTimeMillis());
MetricInfoAppender metricInfoAppender = metricInfoAppenderFactory.create();
metricInfoAppender.appendMetricInfo(range, nodeList, linkDataDuplexMap);
return new DefaultApplicationMap(range, nodeList, linkList);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList 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);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method createTomcatToBlocLink.
private Link createTomcatToBlocLink() {
LinkList linkList = new LinkList();
Node from = new Node(new Application("from", TOMCAT));
Node to = new Node(new Application("to", BLOC));
Link link = new Link(CreateType.Source, from, to, Range.newRange(0, 0));
return link;
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkList in project pinpoint by naver.
the class LinkListTest method createTomcatToTomcatLink.
private Link createTomcatToTomcatLink() {
LinkList linkList = new LinkList();
Node from = new Node(new Application("from", TOMCAT));
Node to = new Node(new Application("to", TOMCAT));
Link link = new Link(CreateType.Source, from, to, Range.newRange(0, 0));
return link;
}
Aggregations