use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class ApplicationScatterScanResultSerializer method serialize.
@Override
public void serialize(ApplicationScatterScanResult value, JsonGenerator jgen, SerializerProvider provider) throws IOException, JsonProcessingException {
jgen.writeStartObject();
Application application = value.getApplication();
jgen.writeStringField("applicationName", application.getName());
jgen.writeNumberField("applicationServiceType", application.getServiceTypeCode());
jgen.writeFieldName("scatter");
jgen.writeObject(value.getScatterScanResult());
jgen.writeEndObject();
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class BFSLinkSelector method checkUnsearchEmulationCalleeNode.
private void checkUnsearchEmulationCalleeNode(LinkDataDuplexMap searchResult, Range range) {
List<Application> unvisitedList = getUnvisitedEmulationNode();
if (unvisitedList.isEmpty()) {
logger.debug("unvisited callee node not found");
return;
}
logger.info("unvisited callee node {}", unvisitedList);
final LinkDataMap calleeLinkData = new LinkDataMap();
for (Application application : unvisitedList) {
LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(application, range);
logger.debug("calleeNode:{}", callee);
calleeLinkData.addLinkDataMap(callee);
}
LinkDataMap unvisitedNodeFilter = new LinkDataMap();
for (LinkData linkData : calleeLinkData.getLinkDataList()) {
Application fromApplication = linkData.getFromApplication();
if (!fromApplication.getServiceType().isWas()) {
continue;
}
Application emulatedApplication = linkData.getToApplication();
boolean unvisitedNode = isUnVisitedNode(unvisitedList, emulatedApplication, fromApplication);
if (unvisitedNode) {
logger.debug("EmulationCalleeNode:{}", linkData);
unvisitedNodeFilter.addLinkData(linkData);
}
}
logger.debug("UnVisitedNode:{}", unvisitedNodeFilter);
for (LinkData linkData : unvisitedNodeFilter.getLinkDataList()) {
searchResult.addTargetLinkData(linkData);
}
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class BFSLinkSelector method getLinkKey.
private LinkKey getLinkKey(LinkData emulationLinkData) {
Application fromApplication = emulationLinkData.getFromApplication();
Application toApplication = emulationLinkData.getToApplication();
return new LinkKey(fromApplication, toApplication);
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class BFSLinkSelector method selectLink.
/**
* Queries for all applications(caller&callee) called by the targetApplicationList
*
* @param targetApplicationList
* @param range
* @return
*/
private LinkDataDuplexMap selectLink(List<Application> targetApplicationList, Range range, SearchDepth callerDepth, SearchDepth calleeDepth) {
final LinkDataDuplexMap searchResult = new LinkDataDuplexMap();
for (Application targetApplication : targetApplicationList) {
final boolean searchCallerNode = checkNextCaller(targetApplication, callerDepth);
if (searchCallerNode) {
final LinkDataMap caller = mapStatisticsCallerDao.selectCaller(targetApplication, range);
if (logger.isDebugEnabled()) {
logger.debug("Found Caller. count={}, caller={}, depth={}", caller.size(), targetApplication, callerDepth.getDepth());
}
final LinkDataMap replaceRpcCaller = replaceRpcCaller(caller, range);
for (LinkData link : replaceRpcCaller.getLinkDataList()) {
searchResult.addSourceLinkData(link);
final Application toApplication = link.getToApplication();
// skip if nextApplication is a terminal or an unknown cloud
if (toApplication.getServiceType().isTerminal() || toApplication.getServiceType().isUnknown()) {
continue;
}
addNextNode(toApplication);
}
}
final boolean searchCalleeNode = checkNextCallee(targetApplication, calleeDepth);
if (searchCalleeNode) {
final LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(targetApplication, range);
if (logger.isInfoEnabled()) {
logger.debug("Found Callee. count={}, callee={}, depth={}", callee.size(), targetApplication, calleeDepth.getDepth());
}
for (LinkData stat : callee.getLinkDataList()) {
searchResult.addTargetLinkData(stat);
final Application fromApplication = stat.getFromApplication();
addNextNode(fromApplication);
}
}
}
logger.debug("{} depth search end", callerDepth.getDepth());
return searchResult;
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class BFSLinkSelector method fillEmulationLink.
private void fillEmulationLink(LinkDataDuplexMap linkDataDuplexMap, Range range) {
// TODO need to be reimplemented - virtual node creation logic needs an overhaul.
// Currently, only the reversed relationship node is displayed. We need to create a virtual node and convert the rpc data appropriately.
logger.debug("this.emulationLinkMarker:{}", this.emulationLinkMarker);
List<LinkData> emulationLinkDataList = findEmulationLinkData(linkDataDuplexMap);
for (LinkData emulationLinkData : emulationLinkDataList) {
LinkCallDataMap beforeImage = emulationLinkData.getLinkCallDataMap();
logger.debug("beforeImage:{}", beforeImage);
emulationLinkData.resetLinkData();
LinkKey findLinkKey = new LinkKey(emulationLinkData.getFromApplication(), emulationLinkData.getToApplication());
LinkData targetLinkData = linkDataDuplexMap.getTargetLinkData(findLinkKey);
if (targetLinkData == null) {
// This is a case where the emulation target node has been only "partially" visited, (ie. does not have a target link data)
// Most likely due to the limit imposed by inbound search depth.
// Must go fetch the target link data here.
final Application targetApplication = emulationLinkData.getToApplication();
final LinkDataMap callee = mapStatisticsCalleeDao.selectCallee(targetApplication, range);
targetLinkData = callee.getLinkData(findLinkKey);
if (targetLinkData == null) {
// There has been a case where targetLinkData was null, but exact event could not be captured for analysis.
// Logging the case for further analysis should it happen again in the future.
logger.error("targetLinkData not found findLinkKey:{}", findLinkKey);
continue;
}
}
// create reversed link data - convert data accepted by the target to target's call data
LinkCallDataMap targetList = targetLinkData.getLinkCallDataMap();
Collection<LinkCallData> beforeLinkDataList = beforeImage.getLinkDataList();
LinkCallData beforeLinkCallData = beforeLinkDataList.iterator().next();
for (LinkCallData agentHistogram : targetList.getLinkDataList()) {
Collection<TimeHistogram> timeHistogramList = agentHistogram.getTimeHistogram();
LinkCallDataMap linkCallDataMap = emulationLinkData.getLinkCallDataMap();
if (logger.isDebugEnabled()) {
logger.debug("emulationLink BEFORE:{}", beforeLinkCallData);
logger.debug("emulationLink agent:{}", agentHistogram);
logger.debug("emulationLink link:{}/{} -> {}/{}", agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType().getCode());
}
linkCallDataMap.addCallData(agentHistogram.getTarget(), agentHistogram.getTargetServiceType(), beforeLinkCallData.getTarget(), beforeLinkCallData.getTargetServiceType(), timeHistogramList);
}
}
}
Aggregations