Skip to content

Commit

Permalink
[#noissue] Remove Deprecated API of ServerMap
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jan 18, 2024
1 parent 1c7fb8d commit 56e3396
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 85 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public FilterMapWrap(ApplicationMap applicationMap, TimeHistogramFormat timeHist
this.applicationMap = applicationMap;

if(timeHistogramFormat == TimeHistogramFormat.V2) {
for(Node node : applicationMap.getNodes()) {
for (Node node : applicationMap.getNodes()) {
node.setTimeHistogramFormat(timeHistogramFormat);
}
for(Link link : applicationMap.getLinks()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
import com.navercorp.pinpoint.web.applicationmap.ApplicationMap;
import com.navercorp.pinpoint.web.applicationmap.FilterMapWrap;
import com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogramFormat;
import com.navercorp.pinpoint.web.applicationmap.map.MapViews;
import com.navercorp.pinpoint.web.applicationmap.nodes.NodeViews;
import com.navercorp.pinpoint.web.applicationmap.service.FilteredMapService;
import com.navercorp.pinpoint.web.applicationmap.service.FilteredMapServiceOption;
Expand Down Expand Up @@ -72,6 +73,7 @@ public FilteredMapController(
}

@GetMapping(value = "/getFilteredServerMapDataMadeOfDotGroup", params = "serviceTypeCode")
@JsonView({MapViews.Detailed.class})
public FilterMapWrap getFilteredServerMapDataMadeOfDotGroup(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam("serviceTypeCode") short serviceTypeCode,
Expand Down Expand Up @@ -108,6 +110,7 @@ public FilterMapWrap getFilteredServerMapDataMadeOfDotGroup(
}

@GetMapping(value = "/getFilteredServerMapDataMadeOfDotGroup", params = "serviceTypeName")
@JsonView({MapViews.Detailed.class})
public FilterMapWrap getFilteredServerMapDataMadeOfDotGroup(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam(value = "serviceTypeName", required = false) String serviceTypeName,
Expand Down Expand Up @@ -137,14 +140,10 @@ public FilterMapWrap getFilteredServerMapDataMadeOfDotGroup(
// needed to figure out already scanned ranged
final Range scannerRange = Range.between(lastScanTime, to);
logger.debug("originalRange: {}, scannerRange: {}", originalRange, scannerRange);
final FilteredMapServiceOption option = new FilteredMapServiceOption.Builder(
limitedScanResult.getScanData(),
originalRange,
xGroupUnit,
yGroupUnit,
filter,
viewVersion
).setUseStatisticsAgentState(useStatisticsAgentState).build();
final FilteredMapServiceOption option = new FilteredMapServiceOption
.Builder(limitedScanResult.getScanData(), originalRange, xGroupUnit, yGroupUnit, filter, viewVersion)
.setUseStatisticsAgentState(useStatisticsAgentState)
.build();
final ApplicationMap map = filteredMapService.selectApplicationMapWithScatterData(option);

if (logger.isDebugEnabled()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -92,82 +92,6 @@ private SearchOption.Builder searchOptionBuilder() {
return SearchOption.newBuilder(DEFAULT_MAX_SEARCH_DEPTH);
}

/**
* Server map data query within from ~ to timeframe
*
* @param applicationName applicationName
* @param serviceTypeCode serviceTypeCode
* @param from from (timestamp)
* @param to to (timestamp)
* @return MapWrap
*/
@GetMapping(value = "/getServerMapData", params = "serviceTypeCode")
@JsonView(MapViews.Detailed.class)
public MapWrap getServerMapData(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam("serviceTypeCode") short serviceTypeCode,
@RequestParam("from") @PositiveOrZero long from,
@RequestParam("to") @PositiveOrZero long to,
@RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH)
@Positive int outDepth,
@RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH)
@Positive int inDepth,
@RequestParam(value = "bidirectional", defaultValue = "true", required = false) boolean bidirectional,
@RequestParam(value = "wasOnly", defaultValue = "false", required = false) boolean wasOnly) {
final Range range = Range.between(from, to);
this.dateLimit.limit(range);

final SearchOption searchOption = searchOptionBuilder().build(outDepth, inDepth, bidirectional, wasOnly);

final Application application = applicationFactory.createApplication(applicationName, serviceTypeCode);

final MapServiceOption option = new MapServiceOption
.Builder(application, range, searchOption)
.setUseStatisticsAgentState(false)
.build();

return selectApplicationMap(application, option, false);
}

/**
* Server map data query within from ~ to timeframe
*
* @param applicationName applicationName
* @param serviceTypeName serviceTypeName
* @param from from (timestamp)
* @param to to (timestamp)
* @return MapWrap
*/
@GetMapping(value = "/getServerMapData", params = "serviceTypeName")
@JsonView(MapViews.Detailed.class)
public MapWrap getServerMapData(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam("serviceTypeName") @NotBlank String serviceTypeName,
@RequestParam("from") @PositiveOrZero long from,
@RequestParam("to") @PositiveOrZero long to,
@RequestParam(value = "callerRange", defaultValue = DEFAULT_SEARCH_DEPTH)
@Positive int callerRange,
@RequestParam(value = "calleeRange", defaultValue = DEFAULT_SEARCH_DEPTH)
@Positive int calleeRange,
@RequestParam(value = "bidirectional", defaultValue = "true", required = false) boolean bidirectional,
@RequestParam(value = "wasOnly", defaultValue = "false", required = false) boolean wasOnly) {
final Range range = Range.between(from, to);
this.dateLimit.limit(range);

final SearchOption searchOption = searchOptionBuilder().build(callerRange, calleeRange, bidirectional, wasOnly);

final Application application =
applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName);

final MapServiceOption option = new MapServiceOption
.Builder(application, range, searchOption)
.setUseStatisticsAgentState(false)
.build();

return selectApplicationMap(application, option, false);
}


/**
* Server map data query within from ~ to timeframe
*
Expand Down

0 comments on commit 56e3396

Please sign in to comment.