use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class LinkVisitCheckerTest method testVisitCaller.
@Test
public void testVisitCaller() throws Exception {
LinkVisitChecker checker = new LinkVisitChecker();
Application testApplication = new Application("test", ServiceType.STAND_ALONE);
Assert.assertFalse(checker.visitCaller(testApplication));
Assert.assertTrue(checker.visitCaller(testApplication));
Application newApp = new Application("newApp", ServiceType.STAND_ALONE);
Assert.assertFalse(checker.visitCaller(newApp));
Assert.assertTrue(checker.visitCaller(newApp));
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class MapController method getServerMapData.
/**
* Server map data query within from ~ to timeframe
*
* @param applicationName
* @param serviceTypeName
* @param from
* @param to
* @return
*/
@RequestMapping(value = "/getServerMapData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public MapWrap getServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("from") long from, @RequestParam("to") long to, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
final Range range = new Range(from, to);
this.dateLimit.limit(range);
SearchOption searchOption = new SearchOption(callerRange, calleeRange);
assertSearchOption(searchOption);
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);
return selectApplicationMap(application, range, searchOption);
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class MapController method getLastServerMapData.
/**
* Server map data query for the last "Period" timeframe
*
* @param applicationName
* @param serviceTypeCode
* @param period
* @return
*/
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET, params = "serviceTypeCode")
@ResponseBody
public MapWrap getLastServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeCode") short serviceTypeCode, @RequestParam("period") long period, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
long to = TimeUtils.getDelayLastTime();
long from = to - period;
final Range range = new Range(from, to);
this.dateLimit.limit(range);
SearchOption searchOption = new SearchOption(callerRange, calleeRange);
assertSearchOption(searchOption);
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode);
return selectApplicationMap(application, range, searchOption);
}
use of com.navercorp.pinpoint.web.vo.Application in project pinpoint by naver.
the class MapController method getLastServerMapData.
/**
* Server map data query for the last "Period" timeframe
*
* @param applicationName
* @param serviceTypeName
* @param period
* @return
*/
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET, params = "serviceTypeName")
@ResponseBody
public MapWrap getLastServerMapData(@RequestParam("applicationName") String applicationName, @RequestParam("serviceTypeName") String serviceTypeName, @RequestParam("period") long period, @RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH) int callerRange, @RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH) int calleeRange) {
long to = TimeUtils.getDelayLastTime();
long from = to - period;
final Range range = new Range(from, to);
this.dateLimit.limit(range);
SearchOption searchOption = new SearchOption(callerRange, calleeRange);
assertSearchOption(searchOption);
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);
return selectApplicationMap(application, range, searchOption);
}
use of com.navercorp.pinpoint.web.vo.Application 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);
}
}
}
}
Aggregations