Search in sources :

Example 6 with LinkCallDataMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by pinpoint-apm.

the class DefaultNodeHistogramFactory method createQueueNodeHistogram.

@Override
public NodeHistogram createQueueNodeHistogram(Application queueApplication, Range range, LinkList linkList) {
    final List<Link> toLinkList = linkList.findToLink(queueApplication);
    if (toLinkList.isEmpty()) {
        return new NodeHistogram(queueApplication, range);
    }
    final NodeHistogram nodeHistogram = new NodeHistogram(queueApplication, range);
    // create applicationHistogram
    final Histogram applicationHistogram = new Histogram(queueApplication.getServiceType());
    for (Link link : toLinkList) {
        applicationHistogram.add(link.getHistogram());
    }
    nodeHistogram.setApplicationHistogram(applicationHistogram);
    // create applicationTimeHistogram
    LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
    for (Link link : toLinkList) {
        LinkCallDataMap linkCallDataMapToUse = link.getSourceLinkCallDataMap();
        // depending on whether the link has been generated with the queue node as the caller, or the callee.
        if (linkCallDataMapToUse.getLinkDataList().isEmpty()) {
            linkCallDataMapToUse = link.getTargetLinkCallDataMap();
        }
        linkCallDataMap.addLinkDataMap(linkCallDataMapToUse);
    }
    ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(queueApplication, range);
    ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
    nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
    return nodeHistogram;
}
Also used : Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Example 7 with LinkCallDataMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by pinpoint-apm.

the class DefaultNodeHistogramFactory method createTerminalNodeHistogram.

@Override
public NodeHistogram createTerminalNodeHistogram(Application terminalApplication, Range range, LinkList linkList) {
    // for Terminal nodes, add all links pointing to the application and create the histogram
    final NodeHistogram nodeHistogram = new NodeHistogram(terminalApplication, range);
    // create applicationHistogram
    final List<Link> toLinkList = linkList.findToLink(terminalApplication);
    final Histogram applicationHistogram = new Histogram(terminalApplication.getServiceType());
    for (Link link : toLinkList) {
        applicationHistogram.add(link.getHistogram());
    }
    nodeHistogram.setApplicationHistogram(applicationHistogram);
    // create applicationTimeHistogram
    LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
    for (Link link : toLinkList) {
        LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
        linkCallDataMap.addLinkDataMap(sourceLinkCallDataMap);
    }
    ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(terminalApplication, range);
    ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
    nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
    // for Terminal nodes, create AgentLevel histogram
    if (terminalApplication.getServiceType().isTerminal() || terminalApplication.getServiceType().isAlias()) {
        LinkCallDataMap mergeSource = new LinkCallDataMap();
        final Map<String, Histogram> agentHistogramMap = new HashMap<>();
        for (Link link : toLinkList) {
            LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
            mergeSource.addLinkDataMap(sourceLinkCallDataMap);
            AgentHistogramList targetList = sourceLinkCallDataMap.getTargetList();
            for (AgentHistogram histogram : targetList.getAgentHistogramList()) {
                Histogram find = agentHistogramMap.get(histogram.getId());
                if (find == null) {
                    find = new Histogram(histogram.getServiceType());
                    agentHistogramMap.put(histogram.getId(), find);
                }
                find.add(histogram.getHistogram());
            }
            nodeHistogram.setAgentHistogramMap(agentHistogramMap);
        }
        AgentTimeHistogramBuilder agentTimeBuilder = new AgentTimeHistogramBuilder(terminalApplication, range);
        AgentTimeHistogram agentTimeHistogram = agentTimeBuilder.buildTarget(mergeSource);
        nodeHistogram.setAgentTimeHistogram(agentTimeHistogram);
    }
    return nodeHistogram;
}
Also used : AgentTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogramBuilder) Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) HashMap(java.util.HashMap) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList) Link(com.navercorp.pinpoint.web.applicationmap.link.Link)

Example 8 with LinkCallDataMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.

the class ApplicationMapBuilder method createTerminalNodeHistogram.

private NodeHistogram createTerminalNodeHistogram(Node node, LinkList linkList) {
    // for Terminal nodes, add all links pointing to iself and create the histogram
    final Application nodeApplication = node.getApplication();
    final NodeHistogram nodeHistogram = new NodeHistogram(nodeApplication, range);
    // create applicationHistogram
    final List<Link> toLinkList = linkList.findToLink(nodeApplication);
    final Histogram applicationHistogram = new Histogram(node.getServiceType());
    for (Link link : toLinkList) {
        applicationHistogram.add(link.getHistogram());
    }
    nodeHistogram.setApplicationHistogram(applicationHistogram);
    // create applicationTimeHistogram
    LinkCallDataMap linkCallDataMap = new LinkCallDataMap();
    for (Link link : toLinkList) {
        LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
        linkCallDataMap.addLinkDataMap(sourceLinkCallDataMap);
    }
    ApplicationTimeHistogramBuilder builder = new ApplicationTimeHistogramBuilder(nodeApplication, range);
    ApplicationTimeHistogram applicationTimeHistogram = builder.build(linkCallDataMap.getLinkDataList());
    nodeHistogram.setApplicationTimeHistogram(applicationTimeHistogram);
    // for Terminal nodes, create AgentLevel histogram
    if (nodeApplication.getServiceType().isTerminal() || nodeApplication.getServiceType().isQueue()) {
        final Map<String, Histogram> agentHistogramMap = new HashMap<>();
        for (Link link : toLinkList) {
            LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
            AgentHistogramList targetList = sourceLinkCallDataMap.getTargetList();
            for (AgentHistogram histogram : targetList.getAgentHistogramList()) {
                Histogram find = agentHistogramMap.get(histogram.getId());
                if (find == null) {
                    find = new Histogram(histogram.getServiceType());
                    agentHistogramMap.put(histogram.getId(), find);
                }
                find.add(histogram.getHistogram());
            }
            nodeHistogram.setAgentHistogramMap(agentHistogramMap);
        }
    }
    LinkCallDataMap mergeSource = new LinkCallDataMap();
    for (Link link : toLinkList) {
        LinkCallDataMap sourceLinkCallDataMap = link.getSourceLinkCallDataMap();
        mergeSource.addLinkDataMap(sourceLinkCallDataMap);
    }
    AgentTimeHistogramBuilder agentTimeBuilder = new AgentTimeHistogramBuilder(nodeApplication, range);
    AgentTimeHistogram agentTimeHistogram = agentTimeBuilder.buildTarget(mergeSource);
    nodeHistogram.setAgentTimeHistogram(agentTimeHistogram);
    return nodeHistogram;
}
Also used : AgentTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogramBuilder) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) Histogram(com.navercorp.pinpoint.web.applicationmap.histogram.Histogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) ApplicationTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram) AgentTimeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram) ApplicationTimeHistogramBuilder(com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder) HashMap(java.util.HashMap) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) NodeHistogram(com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList) Application(com.navercorp.pinpoint.web.vo.Application)

Example 9 with LinkCallDataMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by naver.

the class MapStatisticsCallerDataCollector method collect.

@Override
public void collect() {
    if (init.get()) {
        return;
    }
    LinkDataMap callerDataMap = mapStatisticsCallerDao.selectCaller(application, new Range(timeSlotEndTime - slotInterval, timeSlotEndTime));
    for (LinkData linkData : callerDataMap.getLinkDataList()) {
        LinkCallDataMap linkCallDataMap = linkData.getLinkCallDataMap();
        for (LinkCallData linkCallData : linkCallDataMap.getLinkDataList()) {
            calleStatMap.put(linkCallData.getTarget(), linkCallData);
        }
    }
    init.set(true);
}
Also used : LinkData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData) LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) Range(com.navercorp.pinpoint.web.vo.Range) LinkCallData(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData) LinkDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)

Example 10 with LinkCallDataMap

use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap in project pinpoint by pinpoint-apm.

the class Link method createHistogram0.

private Histogram createHistogram0() {
    // need serviceType of target (callee)
    // ie. Tomcat -> Arcus: we need arcus type
    final LinkCallDataMap findMap = getLinkCallDataMap();
    AgentHistogramList targetList = findMap.getTargetList();
    return targetList.mergeHistogram(toNode.getServiceType());
}
Also used : LinkCallDataMap(com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap) AgentHistogramList(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)

Aggregations

LinkCallDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallDataMap)14 AgentTimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogram)5 ApplicationTimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram)5 ApplicationTimeHistogramBuilder (com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogramBuilder)5 Histogram (com.navercorp.pinpoint.web.applicationmap.histogram.Histogram)5 NodeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram)5 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)5 LinkCallData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkCallData)5 LinkData (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData)5 Link (com.navercorp.pinpoint.web.applicationmap.link.Link)4 AgentTimeHistogramBuilder (com.navercorp.pinpoint.web.applicationmap.histogram.AgentTimeHistogramBuilder)3 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)3 HashMap (java.util.HashMap)3 TimeHistogram (com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram)2 LinkKey (com.navercorp.pinpoint.web.vo.LinkKey)2 Application (com.navercorp.pinpoint.web.vo.Application)1 Range (com.navercorp.pinpoint.web.vo.Range)1