use of com.vip.saturn.job.console.mybatis.entity.SaturnStatistics in project Saturn by vipshop.
the class DashboardController method top10FailExecutor.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10FailExecutor")
public SuccessResponseEntity top10FailExecutor(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.top10FailureExecutor(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.top10FailureExecutorByAllZkCluster());
}
use of com.vip.saturn.job.console.mybatis.entity.SaturnStatistics in project Saturn by vipshop.
the class DashboardController method top10UnstableDomain.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10UnstableDomain")
public SuccessResponseEntity top10UnstableDomain(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.top10UnstableDomain(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.top10UnstableDomainByAllZkCluster());
}
use of com.vip.saturn.job.console.mybatis.entity.SaturnStatistics in project Saturn by vipshop.
the class DashboardController method top10LoadExecutor.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10LoadExecutor")
public SuccessResponseEntity top10LoadExecutor(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.top10LoadExecutor(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.top10LoadExecutorByAllZkCluster());
}
use of com.vip.saturn.job.console.mybatis.entity.SaturnStatistics in project Saturn by vipshop.
the class DashboardController method domainProcessCount.
@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/domainProcessCount")
public SuccessResponseEntity domainProcessCount(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
if (StringUtils.isNotBlank(zkClusterKey)) {
ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
SaturnStatistics ss = dashboardService.allProcessAndErrorCountOfTheDay(zkCluster.getZkAddr());
return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
}
return new SuccessResponseEntity(dashboardService.allProcessAndErrorCountOfTheDayByAllZkCluster());
}
use of com.vip.saturn.job.console.mybatis.entity.SaturnStatistics in project Saturn by vipshop.
the class DashboardServiceImpl method top10FailureJobByAllZkCluster.
@Override
public String top10FailureJobByAllZkCluster() throws SaturnJobConsoleException {
List<JobStatistics> jobStatisticsList = new ArrayList<>();
Collection<ZkCluster> zkClusterList = registryCenterService.getOnlineZkClusterList();
for (ZkCluster zkCluster : zkClusterList) {
SaturnStatistics saturnStatistics = top10FailureJob(zkCluster.getZkAddr());
if (saturnStatistics != null) {
String result = saturnStatistics.getResult();
List<JobStatistics> tempList = JSON.parseArray(result, JobStatistics.class);
if (tempList != null) {
jobStatisticsList.addAll(tempList);
}
}
}
jobStatisticsList = DashboardServiceHelper.sortJobByAllTimeFailureRate(jobStatisticsList);
List<JobStatistics> top10FailJob = jobStatisticsList.subList(0, jobStatisticsList.size() > 9 ? 10 : jobStatisticsList.size());
return JSON.toJSONString(top10FailJob);
}
Aggregations