mirror of
https://github.com/wahyd4/pinpoint.git
synced 2026-08-17 08:46:22 +10:00
Merge branch 'master' of https://github.com/denzelsN/pinpoint
This commit is contained in:
@@ -18,6 +18,7 @@ package com.navercorp.pinpoint.web.controller;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.navercorp.pinpoint.common.service.ServiceTypeRegistryService;
|
||||
import com.navercorp.pinpoint.common.util.DateUtils;
|
||||
import com.navercorp.pinpoint.web.applicationmap.ApplicationMap;
|
||||
import com.navercorp.pinpoint.web.applicationmap.FilterMapWrap;
|
||||
@@ -55,6 +56,9 @@ public class FilteredMapController {
|
||||
@Autowired
|
||||
private FilterBuilder filterBuilder;
|
||||
|
||||
@Autowired
|
||||
private ServiceTypeRegistryService registry;
|
||||
|
||||
/**
|
||||
* filtered server map data query within from ~ to timeframe
|
||||
*
|
||||
@@ -66,7 +70,7 @@ public class FilteredMapController {
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getFilteredServerMapData", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/getFilteredServerMapData", method = RequestMethod.GET, params="serviceTypeCode")
|
||||
@ResponseBody
|
||||
public FilterMapWrap getFilteredServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@@ -77,6 +81,32 @@ public class FilteredMapController {
|
||||
@RequestParam(value = "filter", required = false) String filterText,
|
||||
@RequestParam(value = "hint", required = false) String filterHint,
|
||||
@RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) {
|
||||
String serviceTypeName = registry.findServiceType(serviceTypeCode).getName();
|
||||
return getFilteredServerMapData(applicationName, serviceTypeName, from, to, originTo, filterText, filterHint, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* filtered server map data query within from ~ to timeframe
|
||||
*
|
||||
* @param applicationName
|
||||
* @param serviceTypeName
|
||||
* @param from
|
||||
* @param to
|
||||
* @param filterText
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getFilteredServerMapData", method = RequestMethod.GET, params="serviceTypeName")
|
||||
@ResponseBody
|
||||
public FilterMapWrap getFilteredServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@RequestParam("serviceTypeName") String serviceTypeName,
|
||||
@RequestParam("from") long from,
|
||||
@RequestParam("to") long to,
|
||||
@RequestParam("originTo") long originTo,
|
||||
@RequestParam(value = "filter", required = false) String filterText,
|
||||
@RequestParam(value = "hint", required = false) String filterHint,
|
||||
@RequestParam(value = "limit", required = false, defaultValue = "10000") int limit) {
|
||||
limit = LimitUtils.checkRange(limit);
|
||||
final Filter filter = filterBuilder.build(filterText, filterHint);
|
||||
final Range range = new Range(from, to);
|
||||
@@ -109,7 +139,7 @@ public class FilteredMapController {
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getLastFilteredServerMapData", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/getLastFilteredServerMapData", method = RequestMethod.GET, params="serviceTypeCode")
|
||||
@ResponseBody
|
||||
public FilterMapWrap getLastFilteredServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@@ -118,13 +148,36 @@ public class FilteredMapController {
|
||||
@RequestParam(value = "filter", required = false) String filterText,
|
||||
@RequestParam(value = "hint", required = false) String filterHint,
|
||||
@RequestParam(value = "limit", required = false, defaultValue = "1000000") int limit) {
|
||||
String serviceTypeName = this.registry.findServiceType(serviceTypeCode).getName();
|
||||
return getLastFilteredServerMapData(applicationName, serviceTypeName, period, filterText, filterHint, limit);
|
||||
}
|
||||
|
||||
/**
|
||||
* filtered server map data query for the last "Period" up to now
|
||||
*
|
||||
*
|
||||
* @param applicationName
|
||||
* @param serviceTypeName
|
||||
* @param filterText
|
||||
* @param limit
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getLastFilteredServerMapData", method = RequestMethod.GET, params="serviceTypeName")
|
||||
@ResponseBody
|
||||
public FilterMapWrap getLastFilteredServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@RequestParam("serviceTypeName") String serviceTypeName,
|
||||
@RequestParam("period") long period,
|
||||
@RequestParam(value = "filter", required = false) String filterText,
|
||||
@RequestParam(value = "hint", required = false) String filterHint,
|
||||
@RequestParam(value = "limit", required = false, defaultValue = "1000000") int limit) {
|
||||
limit = LimitUtils.checkRange(limit);
|
||||
|
||||
long to = TimeUtils.getDelayLastTime();
|
||||
long from = to - period;
|
||||
// TODO: since realtime query is enabled for now, calling parameters are fixed as "..., to, to, ..."
|
||||
// may need additional @RequestParam("originTo")
|
||||
return getFilteredServerMapData(applicationName, serviceTypeCode, from, to, to, filterText, filterHint, limit);
|
||||
return getFilteredServerMapData(applicationName, serviceTypeName, from, to, to, filterText, filterHint, limit);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -72,18 +72,38 @@ public class MapController {
|
||||
* @param to
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getServerMapData", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/getServerMapData", method = RequestMethod.GET, params="serviceTypeCode")
|
||||
@ResponseBody
|
||||
public MapWrap getServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@RequestParam("serviceTypeCode") short serviceTypeCode,
|
||||
@RequestParam("from") long from,
|
||||
@RequestParam("to") long to) {
|
||||
ServiceType serviceType = registry.findServiceType(serviceTypeCode);
|
||||
return getServerMapData(applicationName, serviceType.getName(), from, to);
|
||||
}
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
final Range range = new Range(from, to);
|
||||
this.dateLimit.limit(from, to);
|
||||
logger.debug("range:{}", TimeUnit.MILLISECONDS.toMinutes(range.getRange()));
|
||||
|
||||
ServiceType serviceType = registry.findServiceType(serviceTypeCode);
|
||||
ServiceType serviceType = registry.findServiceTypeByName(serviceTypeName);
|
||||
Application application = new Application(applicationName, serviceType);
|
||||
|
||||
ApplicationMap map = mapService.selectApplicationMap(application, range);
|
||||
@@ -99,7 +119,7 @@ public class MapController {
|
||||
* @param period
|
||||
* @return
|
||||
*/
|
||||
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/getLastServerMapData", method = RequestMethod.GET, params="serviceTypeCode")
|
||||
@ResponseBody
|
||||
public MapWrap getLastServerMapData(
|
||||
@RequestParam("applicationName") String applicationName,
|
||||
@@ -112,8 +132,28 @@ public class MapController {
|
||||
}
|
||||
|
||||
/**
|
||||
* Possible deprecation expected when UI change push forward to pick a map first from UI
|
||||
* Unfiltered server map request data query
|
||||
* 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) {
|
||||
|
||||
long to = TimeUtils.getDelayLastTime();
|
||||
long from = to - period;
|
||||
return getServerMapData(applicationName, serviceTypeName, from, to);
|
||||
}
|
||||
|
||||
/**
|
||||
* Possible deprecation expected when UI change push forward to pick a map first from UI
|
||||
* Unfiltered server map request data query
|
||||
*
|
||||
* @param model
|
||||
* @param from
|
||||
@@ -125,7 +165,7 @@ public class MapController {
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "/linkStatistics", method = RequestMethod.GET)
|
||||
@RequestMapping(value = "/linkStatistics", method = RequestMethod.GET, params={"sourceServiceType", "targetServiceType"})
|
||||
public String getLinkStatistics(Model model,
|
||||
@RequestParam("from") long from,
|
||||
@RequestParam("to") long to,
|
||||
@@ -133,9 +173,36 @@ public class MapController {
|
||||
@RequestParam("sourceServiceType") short sourceServiceType,
|
||||
@RequestParam("targetApplicationName") String targetApplicationName,
|
||||
@RequestParam("targetServiceType") short targetServiceType) {
|
||||
String sourceServiceTypeName = registry.findServiceType(sourceServiceType).getName();
|
||||
String targetServiceTypeName = registry.findServiceType(targetServiceType).getName();
|
||||
return getLinkStatistics(model, from, to, sourceApplicationName, sourceServiceTypeName, targetApplicationName, targetServiceTypeName);
|
||||
}
|
||||
|
||||
final Application sourceApplication = new Application(sourceApplicationName, registry.findServiceType(sourceServiceType));
|
||||
final Application destinationApplication = new Application(targetApplicationName, registry.findServiceType(targetServiceType));
|
||||
/**
|
||||
* Possible deprecation expected when UI change push forward to pick a map first from UI
|
||||
* Unfiltered server map request data query
|
||||
*
|
||||
* @param model
|
||||
* @param from
|
||||
* @param to
|
||||
* @param sourceApplicationName
|
||||
* @param sourceServiceTypeName
|
||||
* @param targetApplicationName
|
||||
* @param sourceServiceTypeName
|
||||
* @return
|
||||
*/
|
||||
@Deprecated
|
||||
@RequestMapping(value = "/linkStatistics", method = RequestMethod.GET, params={"sourceServiceTypeName", "targetServiceTypeName"})
|
||||
public String getLinkStatistics(Model model,
|
||||
@RequestParam("from") long from,
|
||||
@RequestParam("to") long to,
|
||||
@RequestParam("sourceApplicationName") String sourceApplicationName,
|
||||
@RequestParam("sourceServiceTypeName") String sourceServiceTypeName,
|
||||
@RequestParam("targetApplicationName") String targetApplicationName,
|
||||
@RequestParam("targetServiceTypeName") String targetServiceTypeName) {
|
||||
|
||||
final Application sourceApplication = new Application(sourceApplicationName, registry.findServiceTypeByName(sourceServiceTypeName));
|
||||
final Application destinationApplication = new Application(targetApplicationName, registry.findServiceTypeByName(targetServiceTypeName));
|
||||
final Range range = new Range(from, to);
|
||||
|
||||
NodeHistogram nodeHistogram = mapService.linkStatistics(sourceApplication, destinationApplication, range);
|
||||
|
||||
Reference in New Issue
Block a user