Sentinel源码
2020-07-15 10:37:30 7 举报
Sentinel主流程源码
作者其他创作
大纲/内容
node.addPassRequest(count)
node.increaseBlockQps(count)
WarmUpRateLimiterController
ProcessorSlotChain chain =new DefaultProcessorSlotChain()
滑动时间窗口形成统计数据
rollingCounterInSecond.addBlock(count)
dashboardRules
node.increaseThreadNum()
increaseExceptionQps
canPassCheck()
DEGRADE_GRADE_RT
DEGRADE_GRADE_EXCEPTION_RATIO
Object result = pjp.proceed()
curCount + acquireCount > count
多个SlotStatistics流量统计
推送Rule信息
slotChainBuilder.build()
rollingCounterInSecond.rt() * 1.0 / successCount
SystemSlot
rollingCounterInSecond.addPass(count)
正常统计
StatisticSlot
时间窗口对象WindowWrap<MetricBucket> wrap = data.currentWindow()
ProcessorSlot<Object> chain = lookProcessChain(resourceWrapper);
DefaultController
chain = SlotChainProvider.newSlotChain();
DegradeRulepassCheck()
ClusterBuilderSlot
PriorityWaitException
AuthoritySlot
当前/时间窗平均
First
DEGRADE_GRADE_EXCEPTION_COUNT
DegradeSlotDegradeRuleManager.checkDegrade()
BlockException
QPS/Thread
ClientN
RateLimiterController
SentinelResourceAspect
Client1
不同的限流策略限流算法
官方文档@SentinelResource核心注解AOPaspectj注解万能Debug
avgUsedTokens(node)
WarmUpController
invokeResourceWithSentinel
Container
DegradeSlot
FlowSlot
rollingCounterInSecond.addException(count)
多个Slot
Throwable
类似拦截器链
SphU.entry
CtSph.entryWithPriority()
LeapArray.currentWindow(long)
NacosZK
FlowSlotchecker.checkFlow()
文档
NodeSelectorSlot
Slot(s) in chian
LogSlot
0 条评论
回复 删除
下一页