Search in sources :

Example 6 with SuccessResponseEntity

use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.

the class DashboardController method top10LoadJob.

@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10LoadJob")
public SuccessResponseEntity top10LoadJob(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
    if (StringUtils.isNotBlank(zkClusterKey)) {
        ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
        SaturnStatistics ss = dashboardService.top10LoadJob(zkCluster.getZkAddr());
        return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
    }
    return new SuccessResponseEntity(dashboardService.top10LoadJobByAllZkCluster());
}
Also used : SaturnStatistics(com.vip.saturn.job.console.mybatis.entity.SaturnStatistics) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) ZkCluster(com.vip.saturn.job.console.domain.ZkCluster) ApiResponses(io.swagger.annotations.ApiResponses)

Example 7 with SuccessResponseEntity

use of com.vip.saturn.job.console.controller.SuccessResponseEntity in project Saturn by vipshop.

the class DashboardController method top10ActiveJob.

@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10ActiveJob")
public SuccessResponseEntity top10ActiveJob(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
    if (StringUtils.isNotBlank(zkClusterKey)) {
        ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
        SaturnStatistics ss = dashboardService.top10AactiveJob(zkCluster.getZkAddr());
        return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
    }
    return new SuccessResponseEntity(dashboardService.top10AactiveJobByAllZkCluster());
}
Also used : SaturnStatistics(com.vip.saturn.job.console.mybatis.entity.SaturnStatistics) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) ZkCluster(com.vip.saturn.job.console.domain.ZkCluster) ApiResponses(io.swagger.annotations.ApiResponses)

Example 8 with SuccessResponseEntity

use of com.vip.saturn.job.console.controller.SuccessResponseEntity 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());
}
Also used : SaturnStatistics(com.vip.saturn.job.console.mybatis.entity.SaturnStatistics) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) ZkCluster(com.vip.saturn.job.console.domain.ZkCluster) ApiResponses(io.swagger.annotations.ApiResponses)

Example 9 with SuccessResponseEntity

use of com.vip.saturn.job.console.controller.SuccessResponseEntity 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());
}
Also used : SaturnStatistics(com.vip.saturn.job.console.mybatis.entity.SaturnStatistics) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) ZkCluster(com.vip.saturn.job.console.domain.ZkCluster) ApiResponses(io.swagger.annotations.ApiResponses)

Example 10 with SuccessResponseEntity

use of com.vip.saturn.job.console.controller.SuccessResponseEntity 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());
}
Also used : SaturnStatistics(com.vip.saturn.job.console.mybatis.entity.SaturnStatistics) SuccessResponseEntity(com.vip.saturn.job.console.controller.SuccessResponseEntity) ZkCluster(com.vip.saturn.job.console.domain.ZkCluster) ApiResponses(io.swagger.annotations.ApiResponses)

Aggregations

SuccessResponseEntity (com.vip.saturn.job.console.controller.SuccessResponseEntity)24 ApiResponses (io.swagger.annotations.ApiResponses)23 ZkCluster (com.vip.saturn.job.console.domain.ZkCluster)11 Audit (com.vip.saturn.job.console.aop.annotation.Audit)10 PostMapping (org.springframework.web.bind.annotation.PostMapping)10 SaturnStatistics (com.vip.saturn.job.console.mybatis.entity.SaturnStatistics)8 UserRole (com.vip.saturn.job.console.mybatis.entity.UserRole)6 SystemConfig (com.vip.saturn.job.console.mybatis.entity.SystemConfig)4 Date (java.util.Date)4 SaturnJobConsoleException (com.vip.saturn.job.console.exception.SaturnJobConsoleException)3 User (com.vip.saturn.job.console.mybatis.entity.User)3 GetMapping (org.springframework.web.bind.annotation.GetMapping)3 JSONObject (com.alibaba.fastjson.JSONObject)2 ContainerConfig (com.vip.saturn.job.console.domain.container.ContainerConfig)1 RequestMapping (org.springframework.web.bind.annotation.RequestMapping)1