Java Code Examples for com.alibaba.csp.sentinel.node.ClusterNode#totalException()

The following examples show how to use com.alibaba.csp.sentinel.node.ClusterNode#totalException() . 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: NodeVo.java    From Sentinel-Dashboard-Nacos with Apache License 2.0 6 votes vote down vote up
/**
 * {@link ClusterNode} holds total statistics of the same resource name.
 *
 * @param name resource name.
 * @param node the ClusterNode to be presented.
 * @return node view object.
 */
public static NodeVo fromClusterNode(String name, ClusterNode node) {
    if (node == null) {
        return null;
    }
    NodeVo vo = new NodeVo();
    vo.resource = name;
    vo.threadNum = node.curThreadNum();
    vo.passQps = (long) node.passQps();
    vo.blockQps = (long) node.blockQps();
    vo.totalQps = (long) node.totalQps();
    vo.averageRt = (long) node.avgRt();
    vo.successQps = (long) node.successQps();
    vo.exceptionQps = (long) node.exceptionQps();
    vo.oneMinuteException = node.totalException();
    vo.oneMinutePass = node.totalRequest() - node.blockRequest();
    vo.oneMinuteBlock = node.blockRequest();
    vo.oneMinuteTotal = node.totalRequest();
    vo.timestamp = System.currentTimeMillis();
    return vo;
}
 
Example 2
Source File: NodeVo.java    From Sentinel with Apache License 2.0 6 votes vote down vote up
/**
 * {@link ClusterNode} holds total statistics of the same resource name.
 *
 * @param name resource name.
 * @param node the ClusterNode to be presented.
 * @return node view object.
 */
public static NodeVo fromClusterNode(String name, ClusterNode node) {
    if (node == null) {
        return null;
    }
    NodeVo vo = new NodeVo();
    vo.resource = name;
    vo.threadNum = node.curThreadNum();
    vo.passQps = (long) node.passQps();
    vo.blockQps = (long) node.blockQps();
    vo.totalQps = (long) node.totalQps();
    vo.averageRt = (long) node.avgRt();
    vo.successQps = (long) node.successQps();
    vo.exceptionQps = (long) node.exceptionQps();
    vo.oneMinuteException = node.totalException();
    vo.oneMinutePass = node.totalRequest() - node.blockRequest();
    vo.oneMinuteBlock = node.blockRequest();
    vo.oneMinuteTotal = node.totalRequest();
    vo.timestamp = System.currentTimeMillis();
    return vo;
}