Search in sources :

Example 1 with LinkHistogramSummary

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);
}
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)

Example 2 with LinkHistogramSummary

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);
}
Also used : LinkHistogramSummary(com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary) Node(com.navercorp.pinpoint.web.applicationmap.nodes.Node) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Example 3 with LinkHistogramSummary

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;
}
Also used : LinkHistogramSummary(com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary) Range(com.navercorp.pinpoint.web.vo.Range) Application(com.navercorp.pinpoint.web.vo.Application) GetMapping(org.springframework.web.bind.annotation.GetMapping)

Aggregations

LinkHistogramSummary (com.navercorp.pinpoint.web.applicationmap.link.LinkHistogramSummary)3 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)2 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)1 CreateType (com.navercorp.pinpoint.web.applicationmap.link.CreateType)1 LinkList (com.navercorp.pinpoint.web.applicationmap.link.LinkList)1 Node (com.navercorp.pinpoint.web.applicationmap.nodes.Node)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 Application (com.navercorp.pinpoint.web.vo.Application)1 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)1 Range (com.navercorp.pinpoint.web.vo.Range)1 GetMapping (org.springframework.web.bind.annotation.GetMapping)1