Search in sources :

Example 36 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster in project Saturn by vipshop.

the class DashboardController method top10FailJob.

@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10FailJob")
public SuccessResponseEntity top10FailJob(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
    if (StringUtils.isNotBlank(zkClusterKey)) {
        ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
        SaturnStatistics ss = dashboardService.top10FailureJob(zkCluster.getZkAddr());
        return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
    }
    return new SuccessResponseEntity(dashboardService.top10FailureJobByAllZkCluster());
}
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 37 with ZkCluster

use of com.vip.saturn.job.console.domain.ZkCluster in project Saturn by vipshop.

the class DashboardController method top10FailDomain.

@ApiResponses(value = { @ApiResponse(code = 200, message = "Success/Fail", response = RequestResult.class) })
@GetMapping(value = "/top10FailDomain")
public SuccessResponseEntity top10FailDomain(@RequestParam(required = false) String zkClusterKey) throws SaturnJobConsoleException {
    if (StringUtils.isNotBlank(zkClusterKey)) {
        ZkCluster zkCluster = checkAndGetZkCluster(zkClusterKey);
        SaturnStatistics ss = dashboardService.top10FailureDomain(zkCluster.getZkAddr());
        return ss == null ? new SuccessResponseEntity() : new SuccessResponseEntity(ss.getResult());
    }
    return new SuccessResponseEntity(dashboardService.top10FailureDomainByAllZkCluster());
}
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