Skip to content

Commit

Permalink
[#11050] Refactor NodeHistogram
Browse files Browse the repository at this point in the history
  • Loading branch information
emeroad committed Jun 7, 2024
1 parent a314e90 commit 5ddd983
Show file tree
Hide file tree
Showing 8 changed files with 143 additions and 155 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
import com.navercorp.pinpoint.web.applicationmap.service.MapServiceOption;
import com.navercorp.pinpoint.web.applicationmap.service.ResponseTimeHistogramService;
import com.navercorp.pinpoint.web.applicationmap.service.ResponseTimeHistogramServiceOption;
import com.navercorp.pinpoint.web.applicationmap.view.NodeHistogramSummaryView;
import com.navercorp.pinpoint.web.component.ApplicationFactory;
import com.navercorp.pinpoint.web.validation.NullOrNotBlank;
import com.navercorp.pinpoint.web.view.ApplicationTimeHistogramViewModel;
Expand Down Expand Up @@ -215,7 +216,7 @@ public ApplicationTimeHistogramViewModel getResponseTimeHistogramData(
}

@PostMapping(value = "/getResponseTimeHistogramDataV2")
public NodeHistogramSummary postResponseTimeHistogramDataV2(
public NodeHistogramSummaryView postResponseTimeHistogramDataV2(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam("serviceTypeCode") Short serviceTypeCode,
@RequestParam("from") @PositiveOrZero long from,
Expand All @@ -241,14 +242,21 @@ public NodeHistogramSummary postResponseTimeHistogramDataV2(
.build();
final NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);

TimeHistogramFormat format = histogramFormat(useLoadHistogramFormat);

Check warning on line 245 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java#L245

Added line #L245 was not covered by tests

return new NodeHistogramSummaryView(nodeHistogramSummary, nodeHistogramSummary.getServerGroupList(), format);

Check warning on line 247 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java#L247

Added line #L247 was not covered by tests
}

private TimeHistogramFormat histogramFormat(boolean useLoadHistogramFormat) {
if (useLoadHistogramFormat) {
nodeHistogramSummary.setTimeHistogramFormat(TimeHistogramFormat.V2);
return TimeHistogramFormat.V2;

Check warning on line 252 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java#L252

Added line #L252 was not covered by tests
} else {
return TimeHistogramFormat.V1;

Check warning on line 254 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java#L254

Added line #L254 was not covered by tests
}
return nodeHistogramSummary;
}

@GetMapping(value = "/getResponseTimeHistogramDataV2")
public NodeHistogramSummary getResponseTimeHistogramDataV2(
public NodeHistogramSummaryView getResponseTimeHistogramDataV2(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam("serviceTypeCode") Short serviceTypeCode,
@RequestParam("from") @PositiveOrZero long from,
Expand Down Expand Up @@ -288,10 +296,9 @@ public NodeHistogramSummary getResponseTimeHistogramDataV2(
.build();

final NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);
if (useLoadHistogramFormat) {
nodeHistogramSummary.setTimeHistogramFormat(TimeHistogramFormat.V2);
}
return nodeHistogramSummary;

final TimeHistogramFormat format = getTimeHistogramFormat(useLoadHistogramFormat);
return new NodeHistogramSummaryView(nodeHistogramSummary, nodeHistogramSummary.getServerGroupList(), format);

Check warning on line 301 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/controller/MapController.java#L300-L301

Added lines #L300 - L301 were not covered by tests
}

private List<Application> toApplications(List<String> applicationNames, List<Short> serviceTypeCodes) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@

package com.navercorp.pinpoint.web.applicationmap.histogram;

import com.navercorp.pinpoint.web.view.TimeSeries.TimeSeriesView;
import com.navercorp.pinpoint.web.view.TimeViewModel;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramChartBuilder;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramType;
import com.navercorp.pinpoint.web.vo.Application;

import java.util.Collections;
Expand Down Expand Up @@ -47,10 +44,6 @@ public List<TimeViewModel> createViewModel(TimeHistogramFormat timeHistogramForm
return format.build(application, histogramList);
}

public TimeSeriesView createTimeSeriesView(TimeHistogramType timeHistogramType) {
return new TimeHistogramChartBuilder(histogramList).build(timeHistogramType);
}

public List<TimeHistogram> getHistogramList() {
return histogramList;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,38 +16,32 @@

package com.navercorp.pinpoint.web.applicationmap.nodes;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.Histogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogramFormat;
import com.navercorp.pinpoint.web.view.NodeHistogramSummarySerializer;
import com.navercorp.pinpoint.web.view.TimeSeries.TimeSeriesView;
import com.navercorp.pinpoint.web.view.histogram.HistogramView;
import com.navercorp.pinpoint.web.view.histogram.ServerHistogramView;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramType;
import com.navercorp.pinpoint.web.vo.Application;

import java.util.List;
import java.util.Objects;

/**
* @author HyunGil Jeong
*/
@JsonSerialize(using = NodeHistogramSummarySerializer.class)
public class NodeHistogramSummary {

private final Application application;
private final ServerGroupList serverGroupList;
private final NodeHistogram nodeHistogram;
private TimeHistogramFormat timeHistogramFormat = TimeHistogramFormat.V1;

public NodeHistogramSummary(Application application, ServerGroupList serverGroupList, NodeHistogram nodeHistogram) {
this.application = Objects.requireNonNull(application, "application");
this.serverGroupList = Objects.requireNonNull(serverGroupList, "serverGroupList");
this.nodeHistogram = Objects.requireNonNull(nodeHistogram, "nodeHistogram");
}

public Application getApplication() {
return application;

Check warning on line 42 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java#L42

Added line #L42 was not covered by tests
}

public ServerGroupList getServerGroupList() {
return serverGroupList;
}
Expand All @@ -60,35 +54,14 @@ public Histogram getHistogram() {
return nodeHistogram.getApplicationHistogram();
}

public TimeSeriesView getNodeTimeHistogram(TimeHistogramType timeHistogramType) {
return nodeHistogram.getApplicationTimeHistogram().createTimeSeriesView(timeHistogramType);
}

public TimeHistogramFormat getTimeHistogramFormat() {
return timeHistogramFormat;
}

public void setTimeHistogramFormat(TimeHistogramFormat timeHistogramFormat) {
this.timeHistogramFormat = timeHistogramFormat;
}

public HistogramView getHistogramView() {
String nodeName = NodeName.toNodeName(application.getName(), application.getServiceType());
Histogram applicationHistogram = nodeHistogram.getApplicationHistogram();
List<TimeHistogram> histogramList = nodeHistogram.getApplicationTimeHistogram().getHistogramList();
return new HistogramView(nodeName, applicationHistogram, histogramList);
}

public ServerHistogramView getAgentHistogramView() {
return new ServerHistogramView(NodeName.of(application), nodeHistogram, serverGroupList);
public ApplicationTimeHistogram getApplicationTimeHistogram() {
return nodeHistogram.getApplicationTimeHistogram();

Check warning on line 58 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java#L58

Added line #L58 was not covered by tests
}

@Override
public String toString() {
final StringBuilder sb = new StringBuilder("NodeHistogramSummary{");
sb.append("serverGroupList=").append(serverGroupList);
sb.append(", nodeHistogram=").append(nodeHistogram);
sb.append('}');
return sb.toString();
return "NodeHistogramSummary{" + "serverGroupList=" + serverGroupList +

Check warning on line 63 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/nodes/NodeHistogramSummary.java#L63

Added line #L63 was not covered by tests
", nodeHistogram=" + nodeHistogram +
'}';
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
package com.navercorp.pinpoint.web.applicationmap.view;

import com.navercorp.pinpoint.common.server.util.json.JsonFields;
import com.navercorp.pinpoint.web.applicationmap.histogram.ApplicationTimeHistogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.Histogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.NodeHistogram;
import com.navercorp.pinpoint.web.applicationmap.histogram.TimeHistogramFormat;
import com.navercorp.pinpoint.web.applicationmap.nodes.NodeHistogramSummary;
import com.navercorp.pinpoint.web.applicationmap.nodes.ServerGroupList;
import com.navercorp.pinpoint.web.view.TimeViewModel;
import com.navercorp.pinpoint.web.view.id.AgentNameView;
import com.navercorp.pinpoint.web.vo.ResponseTimeStatics;

import java.util.List;
import java.util.Map;
import java.util.Objects;

public class NodeHistogramSummaryView {

private final NodeHistogramSummary nodeHistogramSummary;
private final NodeHistogram nodeHistogram;
private final TimeHistogramFormat format;

private final ServerGroupList serverGroupList;

public NodeHistogramSummaryView(NodeHistogramSummary nodeHistogramSummary, ServerGroupList serverGroupList, TimeHistogramFormat format) {
this.nodeHistogramSummary = Objects.requireNonNull(nodeHistogramSummary, "nodeHistogramSummary");
this.nodeHistogram = nodeHistogramSummary.getNodeHistogram();

Check warning on line 28 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L26-L28

Added lines #L26 - L28 were not covered by tests

this.serverGroupList = Objects.requireNonNull(serverGroupList, "serverGroupList");

Check warning on line 30 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L30

Added line #L30 was not covered by tests

this.format = Objects.requireNonNull(format, "format");
}

Check warning on line 33 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L32-L33

Added lines #L32 - L33 were not covered by tests

public long getCurrentServerTime() {
return System.currentTimeMillis();

Check warning on line 36 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L36

Added line #L36 was not covered by tests
}

public ServerGroupList getServerList() {
return serverGroupList;

Check warning on line 40 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L40

Added line #L40 was not covered by tests
}

public ResponseTimeStatics getResponseStatistics() {
return ResponseTimeStatics.fromHistogram(nodeHistogram.getApplicationHistogram());

Check warning on line 44 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L44

Added line #L44 was not covered by tests
}

public Histogram getHistogram() {
return nodeHistogram.getApplicationHistogram();

Check warning on line 48 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L48

Added line #L48 was not covered by tests
}

public Map<String, Histogram> getAgentHistogram() {
return nodeHistogram.getAgentHistogramMap();

Check warning on line 52 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L52

Added line #L52 was not covered by tests
}

public Map<String, ResponseTimeStatics> getAgentResponseStatistics() {
return nodeHistogram.getAgentResponseStatisticsMap();

Check warning on line 56 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L56

Added line #L56 was not covered by tests
}


public List<TimeViewModel> getTimeSeriesHistogram() {
ApplicationTimeHistogram applicationTimeHistogram = nodeHistogramSummary.getApplicationTimeHistogram();

Check warning on line 61 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L61

Added line #L61 was not covered by tests
if (applicationTimeHistogram == null) {
return List.of();

Check warning on line 63 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L63

Added line #L63 was not covered by tests
}
return applicationTimeHistogram.createViewModel(format);

Check warning on line 65 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L65

Added line #L65 was not covered by tests
}

public JsonFields<AgentNameView, List<TimeViewModel>> getAgentTimeSeriesHistogram() {
return nodeHistogram.getAgentTimeHistogram().createViewModel(format);

Check warning on line 69 in web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/applicationmap/view/NodeHistogramSummaryView.java#L69

Added line #L69 was not covered by tests
}
}

Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@
import com.navercorp.pinpoint.web.applicationmap.service.ResponseTimeHistogramService;
import com.navercorp.pinpoint.web.applicationmap.service.ResponseTimeHistogramServiceOption;
import com.navercorp.pinpoint.web.component.ApplicationFactory;
import com.navercorp.pinpoint.web.view.TimeSeries.TimeSeriesView;
import com.navercorp.pinpoint.web.view.histogram.HistogramView;
import com.navercorp.pinpoint.web.view.histogram.ServerHistogramView;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramChart;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramChartBuilder;
import com.navercorp.pinpoint.web.view.histogram.TimeHistogramType;
import com.navercorp.pinpoint.web.vo.Application;
import com.navercorp.pinpoint.web.vo.ApplicationPair;
Expand Down Expand Up @@ -85,7 +86,7 @@ public ServerHistogramView getWasServerHistogramData(
.setUseStatisticsAgentState(false) //set useStatisticsAgentState to false for agent data
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);
return nodeHistogramSummary.getAgentHistogramView();
return ServerHistogramView.view(nodeHistogramSummary);

Check warning on line 89 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L89

Added line #L89 was not covered by tests
}

@GetMapping(value = "/getWas/histogram")
Expand Down Expand Up @@ -120,7 +121,7 @@ public ResponseTimeStatics getWasResponseTimeStatistics(
}

@GetMapping(value = "/getWas/{type}/chart")
public TimeSeriesView getWasTimeHistogramChart(
public TimeHistogramChart getWasTimeHistogramChart(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam(value = "serviceTypeCode", required = false) Short serviceTypeCode,
@RequestParam(value = "serviceTypeName", required = false) @NotBlank String serviceTypeName,
Expand All @@ -137,7 +138,9 @@ public TimeSeriesView getWasTimeHistogramChart(
.setUseStatisticsAgentState(true)
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);
return nodeHistogramSummary.getNodeTimeHistogram(timeHistogramType);
ApplicationTimeHistogram applicationTimeHistogram = nodeHistogramSummary.getApplicationTimeHistogram();

Check warning on line 141 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L141

Added line #L141 was not covered by tests

return chartView(applicationTimeHistogram, timeHistogramType);

Check warning on line 143 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L143

Added line #L143 was not covered by tests
}

@GetMapping(value = "/getWas/histogramData")
Expand All @@ -156,7 +159,7 @@ public HistogramView getWasHistogramData(
.setUseStatisticsAgentState(true)
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);
return nodeHistogramSummary.getHistogramView();
return HistogramView.view(nodeHistogramSummary);

Check warning on line 162 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L162

Added line #L162 was not covered by tests
}

private ResponseTimeHistogramServiceOption.Builder createWasOptionBuilder(Application application, Range range) {
Expand All @@ -183,7 +186,7 @@ public ServerHistogramView postNodeServerHistogramData(
.setUseStatisticsAgentState(false) //set useStatisticsAgentState to false for agent data
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);
return nodeHistogramSummary.getAgentHistogramView();
return ServerHistogramView.view(nodeHistogramSummary);

Check warning on line 189 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L189

Added line #L189 was not covered by tests
}

@PostMapping(value = "/getNode/histogramData")
Expand All @@ -204,11 +207,11 @@ public HistogramView postNodeHistogramData(
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);

return nodeHistogramSummary.getHistogramView();
return HistogramView.view(nodeHistogramSummary);

Check warning on line 210 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L210

Added line #L210 was not covered by tests
}

@PostMapping(value = "/getNode/{type}/chart")
public TimeSeriesView postNodeTimeHistogramChart(
public TimeHistogramChart postNodeTimeHistogramChart(
@RequestParam("applicationName") @NotBlank String applicationName,
@RequestParam(value = "serviceTypeCode", required = false) Short serviceTypeCode,
@RequestParam(value = "serviceTypeName", required = false) @NotBlank String serviceTypeName,
Expand All @@ -227,7 +230,14 @@ public TimeSeriesView postNodeTimeHistogramChart(
.build();
NodeHistogramSummary nodeHistogramSummary = responseTimeHistogramService.selectNodeHistogramData(option);

return nodeHistogramSummary.getNodeTimeHistogram(timeHistogramType);
ApplicationTimeHistogram applicationTimeHistogram = nodeHistogramSummary.getApplicationTimeHistogram();

Check warning on line 233 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L233

Added line #L233 was not covered by tests

return chartView(applicationTimeHistogram, timeHistogramType);

Check warning on line 235 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L235

Added line #L235 was not covered by tests
}

private TimeHistogramChart chartView(ApplicationTimeHistogram applicationTimeHistogram, TimeHistogramType timeHistogramType) {
return new TimeHistogramChartBuilder(applicationTimeHistogram.getHistogramList())
.build(timeHistogramType);

Check warning on line 240 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L239-L240

Added lines #L239 - L240 were not covered by tests
}

@GetMapping(value = "/getLink/histogramData")
Expand Down Expand Up @@ -261,7 +271,7 @@ public HistogramView newHistogramView(LinkHistogramSummary summary) {
}

@GetMapping(value = "/getLink/{type}/chart")
public TimeSeriesView getLinkTimeHistogramChart(
public TimeHistogramChart getLinkTimeHistogramChart(
@RequestParam("fromApplicationName") @NotBlank String fromApplicationName,
@RequestParam(value = "fromServiceTypeCode", required = false) Short fromServiceTypeCode,
@RequestParam(value = "fromServiceTypeName", required = false) @NotBlank String fromServiceTypeName,
Expand All @@ -283,7 +293,8 @@ public TimeSeriesView getLinkTimeHistogramChart(
responseTimeHistogramService.selectLinkHistogramData(fromApplication, toApplication, range);

ApplicationTimeHistogram histogram = linkHistogramSummary.getLinkApplicationTimeHistogram();
return histogram.createTimeSeriesView(timeHistogramType);

return chartView(histogram, timeHistogramType);

Check warning on line 297 in web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java

View check run for this annotation

Codecov / codecov/patch

web/src/main/java/com/navercorp/pinpoint/web/authorization/controller/ResponseTimeController.java#L297

Added line #L297 was not covered by tests
}

private ResponseTimeHistogramServiceOption.Builder createOptionBuilder(Application application, Range range,
Expand Down
Loading

0 comments on commit 5ddd983

Please # to comment.