use of com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary 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);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary in project pinpoint by naver.
the class ResponseTimeHistogramServiceImpl method createEmptyLinkHistogramSummary.
private LinkHistogramSummary createEmptyLinkHistogramSummary(CreateType createType, Application fromApplication, Application toApplication, Range range) {
Node fromNode = new Node(fromApplication);
Node toNode = new Node(toApplication);
Link emptyLink = new Link(createType, fromNode, toNode, range);
return new LinkHistogramSummary(emptyLink);
}
use of com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary in project pinpoint by naver.
the class MapController method getLinkTimeHistogramData.
@GetMapping(value = "/getLinkTimeHistogramData")
public LinkHistogramSummary getLinkTimeHistogramData(@RequestParam(value = "fromApplicationName", required = false) String fromApplicationName, @RequestParam(value = "fromServiceTypeCode", required = false) Short fromServiceTypeCode, @RequestParam(value = "toApplicationName", required = false) String toApplicationName, @RequestParam(value = "toServiceTypeCode", required = false) Short toServiceTypeCode, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam(value = "useLoadHistogramFormat", defaultValue = "false", required = false) boolean useLoadHistogramFormat) {
final Range range = Range.newRange(from, to);
dateLimit.limit(range);
Application fromApplication = null;
if (StringUtils.hasLength(fromApplicationName)) {
fromApplication = applicationFactory.createApplication(fromApplicationName, fromServiceTypeCode);
}
Application toApplication = null;
if (StringUtils.hasLength(toApplicationName)) {
toApplication = applicationFactory.createApplication(toApplicationName, toServiceTypeCode);
}
LinkHistogramSummary linkHistogramSummary = responseTimeHistogramService.selectLinkHistogramData(fromApplication, toApplication, range);
if (useLoadHistogramFormat) {
linkHistogramSummary.setTimeHistogramFormat(TimeHistogramFormat.V2);
}
return linkHistogramSummary;
}
Aggregations