use of com.navercorp.pinpoint.web.applicationmap.link.CreateType in project pinpoint by naver.
the class ResponseTimeHistogramServiceImpl method selectLinkHistogramData.
@Override
public LinkHistogramSummary selectLinkHistogramData(Application fromApplication, Application toApplication, Range range) {
Objects.requireNonNull(fromApplication, "fromApplication");
Objects.requireNonNull(toApplication, "toApplication");
Objects.requireNonNull(range, "range");
LinkDataDuplexMap linkDataDuplexMap;
ServiceType fromApplicationServiceType = fromApplication.getServiceType();
CreateType createType = CreateType.Target;
// For user or queue originating links, we must scan using to applications
if (fromApplicationServiceType.isUser() || fromApplicationServiceType.isQueue()) {
createType = CreateType.Source;
LinkDataMapProcessor sourceApplicationFilter = new SourceApplicationFilter(fromApplication);
LinkSelector linkSelector = linkSelectorFactory.createLinkSelector(LinkSelectorType.UNIDIRECTIONAL, LinkDataMapProcessor.NO_OP, sourceApplicationFilter);
linkDataDuplexMap = linkSelector.select(Collections.singletonList(toApplication), range, 0, 1);
} else {
LinkDataMapProcessor destinationApplication = new DestinationApplicationFilter(toApplication);
LinkSelector linkSelector = linkSelectorFactory.createLinkSelector(LinkSelectorType.UNIDIRECTIONAL, destinationApplication, LinkDataMapProcessor.NO_OP);
linkDataDuplexMap = linkSelector.select(Collections.singletonList(fromApplication), range, 1, 0);
}
NodeList nodeList = NodeListFactory.createNodeList(NodeType.DETAILED, linkDataDuplexMap);
LinkList linkList = LinkListFactory.createLinkList(LinkType.DETAILED, nodeList, linkDataDuplexMap, range);
LinkKey linkKey = new LinkKey(fromApplication, toApplication);
Link link = linkList.getLink(linkKey);
if (link == null) {
return createEmptyLinkHistogramSummary(createType, fromApplication, toApplication, range);
}
return new LinkHistogramSummary(link);
}
Aggregations