类 ClusterNode

java.lang.Object
com.alibaba.csp.sentinel.node.StatisticNode
com.alibaba.csp.sentinel.node.ClusterNode
所有已实现的接口:
Node, OccupySupport, DebugSupport

public class ClusterNode extends StatisticNode

This class stores summary runtime statistics of the resource, including rt, thread count, qps and so on. Same resource shares the same ClusterNode globally, no matter in which Context.

To distinguish invocation from different origin (declared in ContextUtil.enter(String name, String origin)), one ClusterNode holds an originCountMap, this map holds StatisticNode of different origin. Use getOrCreateOriginNode(String) to get Node of the specific origin.
Note that 'origin' usually is Service Consumer's app name.

作者:
qinan.qn, jialiang.linjl
  • 构造器详细资料

    • ClusterNode

      public ClusterNode(String name)
    • ClusterNode

      public ClusterNode(String name, int resourceType)
  • 方法详细资料

    • getName

      public String getName()
      Get resource name of the resource node.
      返回:
      resource name
      从以下版本开始:
      1.7.0
    • getResourceType

      public int getResourceType()
      Get classification (type) of the resource.
      返回:
      resource type
      从以下版本开始:
      1.7.0
    • getOrCreateOriginNode

      public Node getOrCreateOriginNode(String origin)

      Get Node of the specific origin. Usually the origin is the Service Consumer's app name.

      If the origin node for given origin is absent, then a new StatisticNode for the origin will be created and returned.

      参数:
      origin - The caller's name, which is designated in the parameter parameter ContextUtil.enter(String name, String origin).
      返回:
      the Node of the specific origin
    • getOriginCountMap

      public Map<String,StatisticNode> getOriginCountMap()