Search in sources :

Example 81 with Application

use of com.navercorp.pinpoint.web.vo.Application 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 82 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class NodeList method addNode.

public boolean addNode(Node node) {
    if (node == null) {
        throw new NullPointerException("node must not be null");
    }
    final Application nodeId = node.getApplication();
    Node findNode = findNode(nodeId);
    if (findNode != null) {
        return false;
    }
    return nodeMap.put(nodeId, node) == null;
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Example 83 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class AgentTimeHistogram method createViewModel.

public List<AgentResponseTimeViewModel> createViewModel() {
    final List<AgentResponseTimeViewModel> result = new ArrayList<>();
    for (AgentHistogram agentHistogram : agentHistogramList.getAgentHistogramList()) {
        Application agentId = agentHistogram.getAgentId();
        List<TimeHistogram> timeList = sortTimeHistogram(agentHistogram.getTimeHistogram());
        AgentResponseTimeViewModel model = createAgentResponseTimeViewModel(agentId, timeList);
        result.add(model);
    }
    Collections.sort(result, new Comparator<AgentResponseTimeViewModel>() {

        @Override
        public int compare(AgentResponseTimeViewModel o1, AgentResponseTimeViewModel o2) {
            return o1.getAgentName().compareTo(o2.getAgentName());
        }
    });
    return result;
}
Also used : AgentResponseTimeViewModel(com.navercorp.pinpoint.web.view.AgentResponseTimeViewModel) Application(com.navercorp.pinpoint.web.vo.Application) AgentHistogram(com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)

Example 84 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class AgentHistogramList method addAgentHistogram.

public void addAgentHistogram(String agentName, ServiceType serviceType, Collection<TimeHistogram> histogramList) {
    Application agentId = new Application(agentName, serviceType);
    addTimeHistogram(agentId, histogramList);
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Example 85 with Application

use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.

the class AgentHistogramList method addAgentHistogram.

public void addAgentHistogram(String agentName, ServiceType serviceType, TimeHistogram timeHistogram) {
    Application agentId = new Application(agentName, serviceType);
    addTimeHistogram(agentId, timeHistogram);
}
Also used : Application(com.navercorp.pinpoint.web.vo.Application)

Aggregations

Application (com.navercorp.pinpoint.web.vo.Application)90 Test (org.junit.Test)39 Rule (com.navercorp.pinpoint.web.alarm.vo.Rule)30 MapStatisticsCallerDataCollector (com.navercorp.pinpoint.web.alarm.collector.MapStatisticsCallerDataCollector)15 ResponseTimeDataCollector (com.navercorp.pinpoint.web.alarm.collector.ResponseTimeDataCollector)11 AcceptApplication (com.navercorp.pinpoint.web.service.map.AcceptApplication)11 RpcApplication (com.navercorp.pinpoint.web.service.map.RpcApplication)10 Range (com.navercorp.pinpoint.web.vo.Range)10 AgentHistogram (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogram)5 List (java.util.List)5 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)5 ResponseBody (org.springframework.web.bind.annotation.ResponseBody)5 AgentStatDataCollector (com.navercorp.pinpoint.web.alarm.collector.AgentStatDataCollector)4 AgentHistogramList (com.navercorp.pinpoint.web.applicationmap.rawdata.AgentHistogramList)4 LinkDataMap (com.navercorp.pinpoint.web.applicationmap.rawdata.LinkDataMap)4 ArrayList (java.util.ArrayList)4 Buffer (com.navercorp.pinpoint.common.buffer.Buffer)3 ServiceType (com.navercorp.pinpoint.common.trace.ServiceType)3 ErrorCountToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorCountToCalleeChecker)3 ErrorRateToCalleeChecker (com.navercorp.pinpoint.web.alarm.checker.ErrorRateToCalleeChecker)3