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

The following examples show how to use com.alibaba.dubbo.common.status.StatusChecker. These examples are extracted from open source projects. 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 Project: open-capacity-platform   Source File: StatusesController.java    License: 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 Project: open-capacity-platform   Source File: StatusManager.java    License: 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 Project: open-capacity-platform   Source File: StatusManager.java    License: 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 4
Source Project: dubbox   Source File: StatusManager.java    License: 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 5
Source Project: dubbox   Source File: StatusManager.java    License: 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 6
Source Project: dubbox-hystrix   Source File: StatusManager.java    License: 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 Project: dubbox-hystrix   Source File: StatusManager.java    License: 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 8
Source Project: dubbo3   Source File: StatusManager.java    License: 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 9
Source Project: dubbo3   Source File: StatusManager.java    License: 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 10
Source Project: dubbox   Source File: StatusManager.java    License: 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 11
Source Project: dubbo-2.6.5   Source File: ProviderConfig.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}
 
Example 12
Source Project: dubbo-2.6.5   Source File: ProtocolConfig.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}
 
Example 13
Source Project: open-capacity-platform   Source File: StatusController.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatusHandlers(Collection<StatusChecker> statusHandlers) {
    StatusManager.getInstance().addStatusHandlers(statusHandlers);
}
 
Example 14
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setMemoryStatusChecker(StatusChecker memoryStatusChecker) {
    this.memoryStatusChecker = memoryStatusChecker;
}
 
Example 15
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setThreadPoolStatusChecker(StatusChecker threadPoolStatusChecker) {
    this.threadPoolStatusChecker = threadPoolStatusChecker;
}
 
Example 16
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setCacheStatusChecker(StatusChecker cacheStatusChecker) {
    this.cacheStatusChecker = cacheStatusChecker;
}
 
Example 17
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setDatabaseStatusChecker(StatusChecker databaseStatusChecker) {
    this.databaseStatusChecker = databaseStatusChecker;
}
 
Example 18
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setFailureStatusChecker(StatusChecker failureStatusChecker) {
    this.failureStatusChecker = failureStatusChecker;
}
 
Example 19
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setLoadStatusChecker(StatusChecker loadStatusChecker) {
    this.loadStatusChecker = loadStatusChecker;
}
 
Example 20
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setSocketStatusChecker(StatusChecker socketStatusChecker) {
    SocketStatusChecker = socketStatusChecker;
}
 
Example 21
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setTimerStatusChecker(StatusChecker timerStatusChecker) {
    this.timerStatusChecker = timerStatusChecker;
}
 
Example 22
Source Project: open-capacity-platform   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setWarmupStatusChecker(StatusChecker warmupStatusChecker) {
    this.warmupStatusChecker = warmupStatusChecker;
}
 
Example 23
Source Project: open-capacity-platform   Source File: StatusManager.java    License: Apache License 2.0 4 votes vote down vote up
public void addStatusHandler(String name, StatusChecker statusHandler) {
    this.statusHandlers.put(name, statusHandler);
}
 
Example 24
Source Project: open-capacity-platform   Source File: StatusManager.java    License: Apache License 2.0 4 votes vote down vote up
public void addStatusHandlers(Map<String, StatusChecker> statusHandlers) {
    this.statusHandlers.putAll(statusHandlers);
}
 
Example 25
Source Project: dubbox   Source File: ProviderConfig.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}
 
Example 26
Source Project: dubbox   Source File: ProtocolConfig.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatus(String status) {
    checkMultiExtension(StatusChecker.class, "status", status);
    this.status = status;
}
 
Example 27
Source Project: dubbox   Source File: Status.java    License: Apache License 2.0 4 votes vote down vote up
public void setStatusHandlers(Collection<StatusChecker> statusHandlers) {
    StatusManager.getInstance().addStatusHandlers(statusHandlers);
}
 
Example 28
Source Project: dubbox   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setMemoryStatusChecker(StatusChecker memoryStatusChecker) {
    this.memoryStatusChecker = memoryStatusChecker;
}
 
Example 29
Source Project: dubbox   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setThreadPoolStatusChecker(StatusChecker threadPoolStatusChecker) {
    this.threadPoolStatusChecker = threadPoolStatusChecker;
}
 
Example 30
Source Project: dubbox   Source File: GovernanceWarmup.java    License: Apache License 2.0 4 votes vote down vote up
public void setCacheStatusChecker(StatusChecker cacheStatusChecker) {
    this.cacheStatusChecker = cacheStatusChecker;
}