use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.
the class ApplicationMapBuilder method appendLinkHistogram.
private void appendLinkHistogram(Link link, LinkDataDuplexMap linkDataDuplexMap) {
logger.debug("appendLinkHistogram link:{}", link);
LinkKey key = link.getLinkKey();
LinkData sourceLinkData = linkDataDuplexMap.getSourceLinkData(key);
if (sourceLinkData != null) {
link.addSource(sourceLinkData.getLinkCallDataMap());
}
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(key);
if (targetLinkData != null) {
link.addTarget(targetLinkData.getLinkCallDataMap());
}
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.
the class ApplicationMapBuilder method createSourceLink.
private void createSourceLink(NodeList nodeList, LinkList linkList, LinkDataMap linkDataMap) {
for (LinkData linkData : linkDataMap.getLinkDataList()) {
final Application fromApplicationId = linkData.getFromApplication();
Node fromNode = nodeList.findNode(fromApplicationId);
final Application toApplicationId = linkData.getToApplication();
Node toNode = nodeList.findNode(toApplicationId);
// rpc client missing
if (toNode == null) {
logger.warn("toNode rcp client not found:{}", toApplicationId);
continue;
}
// shouldn't really be necessary as rpc client toNodes are converted to unknown nodes beforehand.
if (toNode.getServiceType().isRpcClient()) {
if (!nodeList.containsNode(toNode.getApplication())) {
final Link link = addLink(linkList, fromNode, toNode, CreateType.Source);
if (link != null) {
logger.debug("createRpcSourceLink:{}", link);
}
}
} else {
final Link link = addLink(linkList, fromNode, toNode, CreateType.Source);
if (link != null) {
logger.debug("createSourceLink:{}", link);
}
}
}
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.
the class ApplicationMapBuilder method createNode.
private void createNode(NodeList nodeList, LinkDataMap linkDataMap) {
for (LinkData linkData : linkDataMap.getLinkDataList()) {
final Application fromApplication = linkData.getFromApplication();
// cannot be RPC. Already converted to unknown.
if (!fromApplication.getServiceType().isRpcClient()) {
final boolean success = addNode(nodeList, fromApplication);
if (success) {
logger.debug("createSourceNode:{}", fromApplication);
}
} else {
logger.warn("found rpc fromNode linkData:{}", linkData);
}
final Application toApplication = linkData.getToApplication();
// FROM -> TO : TO is either a CLIENT or a node
if (!toApplication.getServiceType().isRpcClient()) {
final boolean success = addNode(nodeList, toApplication);
if (success) {
logger.debug("createTargetNode:{}", toApplication);
}
} else {
logger.warn("found rpc toNode:{}", linkData);
}
}
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData in project pinpoint by naver.
the class ApplicationMapBuilder method createTargetLink.
private void createTargetLink(NodeList nodeList, LinkList linkList, LinkDataMap linkDataMap) {
for (LinkData linkData : linkDataMap.getLinkDataList()) {
final Application fromApplicationId = linkData.getFromApplication();
Node fromNode = nodeList.findNode(fromApplicationId);
final Application toApplicationId = linkData.getToApplication();
Node toNode = nodeList.findNode(toApplicationId);
// rpc client missing
if (fromNode == null) {
logger.warn("fromNode rcp client not found:{}", toApplicationId);
continue;
}
// for RPC clients: skip if there is a dest application, convert to "unknown cloud" if not
if (toNode.getServiceType().isRpcClient()) {
// check if "to" node exists
if (!nodeList.containsNode(toNode.getApplication())) {
final Link link = addLink(linkList, fromNode, toNode, CreateType.Target);
if (link != null) {
logger.debug("createRpcTargetLink:{}", link);
}
}
} else {
final Link link = addLink(linkList, fromNode, toNode, CreateType.Target);
if (link != null) {
logger.debug("createTargetLink:{}", link);
}
}
}
}
use of com.navercorp.pinpoint.web.applicationmap.rawdata.LinkData 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);
}
Aggregations