com.alibaba.dubbo.common.status.StatusChecker Java Examples

The following examples show how to use com.alibaba.dubbo.common.status.StatusChecker. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: StatusesController.java    From open-capacity-platform with Apache License 2.0 6 votes vote down vote up
@RequestMapping("")
public String index(HttpServletRequest request, HttpServletResponse response, Model model) throws Exception {

    prepare(request, response, model, "index", "status");
    ExtensionLoader<StatusChecker> loader = ExtensionLoader.getExtensionLoader(StatusChecker.class);
    Map<String, Status> statusList = new LinkedHashMap<String, Status>();
    for (String name : loader.getSupportedExtensions()) {
        com.alibaba.dubbo.common.status.Status status = loader.getExtension(name).check();
        if (status.getLevel() != null && status.getLevel() != com.alibaba.dubbo.common.status.Status.Level.UNKNOWN) {
            statusList.put(name, status);
        }
    }
    statusList.put("summary", StatusManager.getStatusSummary(statusList));
    model.addAttribute("statusList", statusList);
    return "sysinfo/screen/statuses/index";
}
 
Example #2
Source File: StatusManager.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void addStatusHandlers(Collection<StatusChecker> statusHandlers) {
    for (StatusChecker statusChecker : statusHandlers) {
        String name = statusChecker.getClass().getSimpleName();
        if (name.endsWith(StatusChecker.class.getSimpleName())) {
            name = name.substring(0, name.length() - StatusChecker.class.getSimpleName().length());
        }
        this.statusHandlers.put(name, statusChecker);
    }
}
 
Example #3
Source File: StatusManager.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
public void addStatusHandlers(Collection<StatusChecker> statusHandlers) {
    for (StatusChecker statusChecker : statusHandlers) {
        String name = statusChecker.getClass().getSimpleName();
        if (name.endsWith(StatusChecker.class.getSimpleName())) {
            name = name.substring(0, name.length() - StatusChecker.class.getSimpleName().length());
        }
        this.statusHandlers.put(name, statusChecker);
    }
}
 
Example #4
Source File: StatusManager.java    From dubbo3 with Apache License 2.0 5 votes vote down vote up
/**
 * 过滤不需要汇总页面的监控项
 */
public Map<String, Status> getStatusList(String[] excludes) {
    Map<String, Status> statuses = new HashMap<String, Status>();
    Map<String, StatusChecker> temp = new HashMap<String, StatusChecker>();
    temp.putAll(statusHandlers);
    if(excludes != null&&excludes.length>0){
        for(String exclude : excludes){
            temp.remove(exclude);
        }
    }
    for (Map.Entry<String, StatusChecker> entry : temp.entrySet()) {
            statuses.put(entry.getKey(), entry.getValue().check());
    }
    return statuses;
}
 
Example #5
Source File: StatusManager.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
/**
 * Exclude items do not need to show in Summary Page
 */
public Map<String, Status> getStatusList(String[] excludes) {
    Map<String, Status> statuses = new HashMap<String, Status>();
    Map<String, StatusChecker> temp = new HashMap<String, StatusChecker>();
    temp.putAll(statusHandlers);
    if (excludes != null && excludes.length > 0) {
        for (String exclude : excludes) {
            temp.remove(exclude);
        }
    }
    for (Map.Entry<String, StatusChecker> entry : temp.entrySet()) {
        statuses.put(entry.getKey(), entry.getValue().check());
    }
    return statuses;
}
 
Example #6
Source File: StatusManager.java    From open-capacity-platform with Apache License 2.0 5 votes vote down vote up
public void addStatusHandlers(Collection<StatusChecker> statusHandlers) {
    for (StatusChecker statusChecker : statusHandlers) {
        String name = statusChecker.getClass().getSimpleName();
        if (name.endsWith(StatusChecker.class.getSimpleName())) {
            name = name.substring(0, name.length() - StatusChecker.class.getSimpleName().length());
        }
        this.statusHandlers.put(name, statusChecker);
    }
}
 
Example #7
Source File: StatusManager.java    From dubbox with Apache License 2.0 5 votes vote down vote up
public void addStatusHandlers(Collection<StatusChecker> statusHandlers) {
    for (StatusChecker statusChecker : statusHandlers) {
        String name = statusChecker.getClass().getSimpleName();
        if (name.endsWith(StatusChecker.class.getSimpleName())) {
            name = name.substring(0, name.length() - StatusChecker.class.getSimpleName().length());
        }
        this.statusHandlers.put(name, statusChecker);
    }
}
 
Example #8
Source File: StatusManager.java    From dubbox with Apache License 2.0 5 votes vote down vote up
/**
 * 过滤不需要汇总页面的监控项
 */
public Map<String, Status> getStatusList(String[] excludes) {
    Map<String, Status> statuses = new HashMap<String, Status>();
    Map<String, StatusChecker> temp = new HashMap<String, StatusChecker>();
    temp.putAll(statusHandlers);
    if(excludes != null&&excludes.length>0){
        for(String exclude : excludes){
            temp.remove(exclude);
        }
    }
    for (Map.Entry<String, StatusChecker> entry : temp.entrySet()) {
            statuses.put(entry.getKey(), entry.getValue().check());
    }
    return statuses;
}
 
Example #9
Source File: StatusManager.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
public void addStatusHandlers(Collection<StatusChecker> statusHandlers) {
    for (StatusChecker statusChecker : statusHandlers) {
        String name = statusChecker.getClass().getSimpleName();
        if (name.endsWith(StatusChecker.class.getSimpleName())) {
            name = name.substring(0, name.length() - StatusChecker.class.getSimpleName().length());
        }
        this.statusHandlers.put(name, statusChecker);
    }
}
 
Example #10
Source File: StatusManager.java    From dubbox-hystrix with Apache License 2.0 5 votes vote down vote up
/**
 * 过滤不需要汇总页面的监控项
 */
public Map<String, Status> getStatusList(String[] excludes) {
    Map<String, Status> statuses = new HashMap<String, Status>();
    Map<String, StatusChecker> temp = new HashMap<String, StatusChecker>();
    temp.putAll(statusHandlers);
    if(excludes != null&&excludes.length>0){
        for(String exclude : excludes){
            temp.remove(exclude);
        }
    }
    for (Map.Entry<String, StatusChecker> entry : temp.entrySet()) {
            statuses.put(entry.getKey(), entry.getValue().check());
    }
    return statuses;
}
 
Example #11
Source File: GovernanceWarmup.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public void setFailureStatusChecker(StatusChecker failureStatusChecker) {
    this.failureStatusChecker = failureStatusChecker;
}
 
Example #12
Source File: GovernanceWarmup.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void setDatabaseStatusChecker(StatusChecker databaseStatusChecker) {
    this.databaseStatusChecker = databaseStatusChecker;
}
 
Example #13
Source File: GovernanceWarmup.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void setTimerStatusChecker(StatusChecker timerStatusChecker) {
    this.timerStatusChecker = timerStatusChecker;
}
 
Example #14
Source File: GovernanceWarmup.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void setLoadStatusChecker(StatusChecker loadStatusChecker) {
    this.loadStatusChecker = loadStatusChecker;
}
 
Example #15
Source File: GovernanceWarmup.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void setSocketStatusChecker(StatusChecker socketStatusChecker) {
    SocketStatusChecker = socketStatusChecker;
}
 
Example #16
Source File: GovernanceWarmup.java    From dubbox with Apache License 2.0 4 votes vote down vote up
public void setFailureStatusChecker(StatusChecker failureStatusChecker) {
    this.failureStatusChecker = failureStatusChecker;
}
 
Example #17
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setSocketStatusChecker(StatusChecker socketStatusChecker) {
    SocketStatusChecker = socketStatusChecker;
}
 
Example #18
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setLoadStatusChecker(StatusChecker loadStatusChecker) {
    this.loadStatusChecker = loadStatusChecker;
}
 
Example #19
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setFailureStatusChecker(StatusChecker failureStatusChecker) {
    this.failureStatusChecker = failureStatusChecker;
}
 
Example #20
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setDatabaseStatusChecker(StatusChecker databaseStatusChecker) {
    this.databaseStatusChecker = databaseStatusChecker;
}
 
Example #21
Source File: GovernanceWarmup.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public void setTimerStatusChecker(StatusChecker timerStatusChecker) {
    this.timerStatusChecker = timerStatusChecker;
}
 
Example #22
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setCacheStatusChecker(StatusChecker cacheStatusChecker) {
    this.cacheStatusChecker = cacheStatusChecker;
}
 
Example #23
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setThreadPoolStatusChecker(StatusChecker threadPoolStatusChecker) {
    this.threadPoolStatusChecker = threadPoolStatusChecker;
}
 
Example #24
Source File: GovernanceWarmup.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public void setWarmupStatusChecker(StatusChecker warmupStatusChecker) {
    this.warmupStatusChecker = warmupStatusChecker;
}
 
Example #25
Source File: StatusManager.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public void addStatusHandler(String name, StatusChecker statusHandler) {
    this.statusHandlers.put(name, statusHandler);
}
 
Example #26
Source File: StatusManager.java    From dubbox-hystrix with Apache License 2.0 4 votes vote down vote up
public void addStatusHandlers(Map<String, StatusChecker> statusHandlers) {
    this.statusHandlers.putAll(statusHandlers);
}
 
Example #27
Source File: GovernanceWarmup.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setMemoryStatusChecker(StatusChecker memoryStatusChecker) {
    this.memoryStatusChecker = memoryStatusChecker;
}
 
Example #28
Source File: Status.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setStatusHandlers(Collection<StatusChecker> statusHandlers) {
    StatusManager.getInstance().addStatusHandlers(statusHandlers);
}
 
Example #29
Source File: ProtocolConfig.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}
 
Example #30
Source File: ProviderConfig.java    From dubbo3 with Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}