forked from pinpoint-apm/pinpoint
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[pinpoint-apm#8755] Remove duplicate application metrics
- Loading branch information
Showing
17 changed files
with
256 additions
and
212 deletions.
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
37 changes: 37 additions & 0 deletions
37
.../com/navercorp/pinpoint/web/authorization/controller/ApplicationDataSourceController.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,37 @@ | ||
package com.navercorp.pinpoint.web.authorization.controller; | ||
|
||
import com.navercorp.pinpoint.common.server.util.time.Range; | ||
import com.navercorp.pinpoint.web.service.appmetric.ApplicationDataSourceService; | ||
import com.navercorp.pinpoint.web.util.TimeWindow; | ||
import com.navercorp.pinpoint.web.util.TimeWindowSlotCentricSampler; | ||
import com.navercorp.pinpoint.web.vo.stat.chart.StatChart; | ||
import org.apache.logging.log4j.LogManager; | ||
import org.apache.logging.log4j.Logger; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.RequestParam; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import java.util.List; | ||
|
||
@RestController | ||
public class ApplicationDataSourceController { | ||
private final Logger logger = LogManager.getLogger(this.getClass()); | ||
|
||
private final ApplicationDataSourceService applicationDataSourceService; | ||
|
||
public ApplicationDataSourceController(ApplicationDataSourceService applicationDataSourceService) { | ||
this.applicationDataSourceService = applicationDataSourceService; | ||
} | ||
|
||
@GetMapping("/getApplicationStat/dataSource/chart") | ||
public List<StatChart> getAgentStatChart(@RequestParam("applicationId") String applicationId, @RequestParam("from") long from, @RequestParam("to") long to) { | ||
TimeWindowSlotCentricSampler sampler = new TimeWindowSlotCentricSampler(); | ||
TimeWindow timeWindow = new TimeWindow(Range.between(from, to), sampler); | ||
try { | ||
return this.applicationDataSourceService.selectApplicationChart(applicationId, timeWindow); | ||
} catch (Exception e ) { | ||
logger.error("error" , e); | ||
throw e; | ||
} | ||
} | ||
} |
Oops, something went wrong.