Search in sources :

Example 1 with CreateType

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);
}
Also used : SourceApplicationFilter(com.navercorp.pinpoint.web.service.map.processor.SourceApplicationFilter) LinkHistogramSummary(com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary) LinkKey(com.navercorp.pinpoint.web.vo.LinkKey) ServiceType(com.navercorp.pinpoint.common.trace.ServiceType) LinkDataMapProcessor(com.navercorp.pinpoint.web.service.map.processor.LinkDataMapProcessor) NodeList(com.navercorp.pinpoint.web.applicationmap.nodes.NodeList) CreateType(com.navercorp.pinpoint.web.applicationmap.link.CreateType) LinkDataDuplexMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap) LinkSelector(com.navercorp.pinpoint.web.service.map.LinkSelector) LinkList(com.navercorp.pinpoint.web.applicationmap.link.LinkList) DestinationApplicationFilter(com.navercorp.pinpoint.web.service.map.processor.DestinationApplicationFilter) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Aggregations

ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 CreateType (com.navercorp.pinpoint.web.applicationmap.link.CreateType)1 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)1 LinkHistogramSummary (com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary)1 LinkList (com.navercorp.pinpoint.web.applicationmap.link.LinkList)1 NodeList (com.navercorp.pinpoint.web.applicationmap.nodes.NodeList)1 LinkDataDuplexMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataDuplexMap)1 LinkSelector (com.navercorp.pinpoint.web.service.map.LinkSelector)1 DestinationApplicationFilter (com.navercorp.pinpoint.web.service.map.processor.DestinationApplicationFilter)1 LinkDataMapProcessor (com.navercorp.pinpoint.web.service.map.processor.LinkDataMapProcessor)1 SourceApplicationFilter (com.navercorp.pinpoint.web.service.map.processor.SourceApplicationFilter)1 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)1