只要资源被访问了,通过了,就统计加1,针对的是所有请求访问该资源。
com.alibaba.csp.sentinel.slots.statistic.StatisticSlot#entry
this.fireEntry(context, resourceWrapper, node, count, prioritized, args);
node.increaseThreadNum();// 线程数 ===》进行隔离
node.addPassRequest(count);// QPS 通过请求数 ===》进行限流
先执行业务,在进行统计StatisticSlot
com.alibaba.csp.sentinel.node.DefaultNode#increaseThreadNum()
super.increaseThreadNum();// 我自己记一次DefaultNode(继承StatisticNode),每个链路单独计
this.clusterNode.increaseThreadNum(); //clusterNode(全局的)资源所在的当前链路(请求进来的这一条链路)
针对流控规则:链路模式===》针对某些链路需要限流,其他入口进来不限流
node.addPassRequest(count);// 采用滑动窗口算法
浙公网安备 33010602011771号