Search in sources :

Example 11 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster 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 12 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster 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 13 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster 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 14 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster 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 15 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster 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

ZkCluster (com.vip.saturn.job.console.domain.ZkCluster)37 SuccessResponseEntity (com.vip.saturn.job.console.controller.SuccessResponseEntity)11 ApiResponses (io.swagger.annotations.ApiResponses)11 SaturnJobConsoleException (com.vip.saturn.job.console.exception.SaturnJobConsoleException)9 SaturnStatistics (com.vip.saturn.job.console.mybatis.entity.SaturnStatistics)8 Entry (java.util.Map.Entry)8 RegistryCenterConfiguration (com.vip.saturn.job.console.domain.RegistryCenterConfiguration)7 HashMap (java.util.HashMap)5 Transactional (org.springframework.transaction.annotation.Transactional)5 SaturnJobConsoleHttpException (com.vip.saturn.job.console.exception.SaturnJobConsoleHttpException)4 ArrayList (java.util.ArrayList)4 CuratorRepository (com.vip.saturn.job.console.repository.zookeeper.CuratorRepository)3 CurrentJobConfig (com.vip.saturn.job.console.mybatis.entity.CurrentJobConfig)2 NamespaceInfo (com.vip.saturn.job.console.mybatis.entity.NamespaceInfo)2 CuratorFramework (org.apache.curator.framework.CuratorFramework)2 JSONObject (com.alibaba.fastjson.JSONObject)1 Audit (com.vip.saturn.job.console.aop.annotation.Audit)1 ExportJobConfigPageStatus (com.vip.saturn.job.console.domain.ExportJobConfigPageStatus)1 JobSettings (com.vip.saturn.job.console.domain.JobSettings)1 TreeNode (com.vip.saturn.job.console.domain.TreeNode)1