-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#8843] Add time series Apdex score chart
- Loading branch information
1 parent
3d7cb17
commit e91a302
Showing
18 changed files
with
1,084 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
185 changes: 185 additions & 0 deletions
185
web/src/main/java/com/navercorp/pinpoint/web/controller/ApdexScoreController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
package com.navercorp.pinpoint.web.controller; | ||
|
||
import com.navercorp.pinpoint.common.server.util.time.Range; | ||
import com.navercorp.pinpoint.web.applicationmap.histogram.ApdexScore; | ||
import com.navercorp.pinpoint.web.service.ApdexScoreService; | ||
import com.navercorp.pinpoint.web.service.ApplicationFactory; | ||
import com.navercorp.pinpoint.web.util.TimeWindow; | ||
import com.navercorp.pinpoint.web.util.TimeWindowSampler; | ||
import com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler; | ||
import com.navercorp.pinpoint.web.view.InspectorView; | ||
import com.navercorp.pinpoint.web.vo.Application; | ||
import com.navercorp.pinpoint.web.vo.stat.chart.InspectorData; | ||
import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.Objects; | ||
|
||
@RestController | ||
public class ApdexScoreController { | ||
private final ApplicationFactory applicationFactory; | ||
private final ApdexScoreService apdexScoreService; | ||
|
||
public ApdexScoreController(ApplicationFactory applicationFactory, ApdexScoreService apdexScoreService) { | ||
this.applicationFactory = Objects.requireNonNull(applicationFactory, "applicationFactory"); | ||
this.apdexScoreService = Objects.requireNonNull(apdexScoreService, "apdexScoreService"); | ||
} | ||
|
||
@GetMapping(value = "/getApdexScore") | ||
public ApdexScore getApdexScore( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeCode") Short serviceTypeCode, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
|
||
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode); | ||
final ApdexScore apdexScore = apdexScoreService.selectApdexScoreData(application, range); | ||
|
||
return apdexScore; | ||
} | ||
|
||
@GetMapping(value = "/getApdexScore", params = "serviceTypeName") | ||
public ApdexScore getApdexScore( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeName") String serviceTypeName, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
|
||
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName); | ||
final ApdexScore apdexScore = apdexScoreService.selectApdexScoreData(application, range); | ||
|
||
return apdexScore; | ||
} | ||
|
||
@GetMapping(value = "/getApplicaionStat/apdexScore/chart") | ||
public StatChart getApplicationApdexScoreChart( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeCode") Short serviceTypeCode, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode); | ||
|
||
return apdexScoreService.selectApplicationChart(application, range, timeWindow); | ||
} | ||
|
||
@GetMapping(value = "/getApplicationStat/apdexScore/chart", params = "serviceTypeName") | ||
public StatChart getAgentApdexScoreScoreChart( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeName") String serviceTypeName, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName); | ||
|
||
return apdexScoreService.selectApplicationChart(application, range, timeWindow); | ||
} | ||
|
||
@GetMapping(value = "/getAgentStat/apdexScore/chart") | ||
public StatChart getAgentApdexScoreChartData( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeCode") Short serviceTypeCode, | ||
@RequestParam("agentId") String agentId, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode); | ||
|
||
return apdexScoreService.selectAgentChart(application, range, timeWindow, agentId); | ||
} | ||
|
||
@GetMapping(value = "/getAgentStat/apdexScore/chart", params = "serviceTypeName") | ||
public StatChart getAgentApdexScoreChartData( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeName") String serviceTypeName, | ||
@RequestParam("agentId") String agentId, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName); | ||
|
||
return apdexScoreService.selectAgentChart(application, range, timeWindow, agentId); | ||
} | ||
|
||
@GetMapping(value = "/getApplicaionStat/apdexScore/inspectorView") | ||
public InspectorView getApplicationApdexScoreView( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeCode") Short serviceTypeCode, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode); | ||
|
||
InspectorData inspectorData = apdexScoreService.selectApplicationInspectorData(application, range, timeWindow); | ||
return new InspectorView(inspectorData); | ||
} | ||
|
||
@GetMapping(value = "/getApplicationStat/apdexScore/inspectorView", params = "serviceTypeName") | ||
public InspectorView getApplicationApdexScoreView( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeName") String serviceTypeName, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName); | ||
|
||
InspectorData inspectorData = apdexScoreService.selectApplicationInspectorData(application, range, timeWindow); | ||
return new InspectorView(inspectorData); | ||
} | ||
|
||
@GetMapping(value = "/getAgentStat/apdexScore/inspectorView") | ||
public InspectorView getAgentApdexScoreView( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeCode") Short serviceTypeCode, | ||
@RequestParam("agentId") String agentId, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplication(applicationName, serviceTypeCode); | ||
|
||
InspectorData inspectorData = apdexScoreService.selectAgentInspectorData(application, range, timeWindow, agentId); | ||
return new InspectorView(inspectorData); | ||
} | ||
|
||
@GetMapping(value = "/getAgentStat/apdexScore/inspectorView", params = "serviceTypeName") | ||
public InspectorView getAgentApdexScoreView( | ||
@RequestParam("applicationName") String applicationName, | ||
@RequestParam("serviceTypeName") String serviceTypeName, | ||
@RequestParam("agentId") String agentId, | ||
@RequestParam("from") long from, | ||
@RequestParam("to") long to) { | ||
final Range range = Range.between(from, to); | ||
TimeWindowSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(range, sampler); | ||
|
||
Application application = applicationFactory.createApplicationByTypeName(applicationName, serviceTypeName); | ||
|
||
InspectorData inspectorData = apdexScoreService.selectAgentInspectorData(application, range, timeWindow, agentId); | ||
return new InspectorView(inspectorData); | ||
} | ||
} |
Oops, something went wrong.