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