这一篇我还是继续上一篇没有讲完的内容,先上一个例子: private static final int threadCount = 100; public static void main(String[] args) { initFlowRule(); for (int i = 0; i < threadCount; i++) { Thread entryThread = new Thread(new Runnable() { @Override public void run() { whi…
直接从Sentinel 源码demo ExceptionRatioCircuitBreakerDemo看起 直接看他的main函数 public static void main(String[] args) throws Exception { initDegradeRule(); ...... final int concurrency = 8; for (int i = 0; i < concurrency; i++) { Thread entryThread = new Thread((…
1. git clone senetinel 源码到本地,切换到release1.8分支 2. 找到FlowQpsDemo.java, 根据sentinel自带的案例来学习sentinel的原理 3. 先看main方法 public static void main(String[] args) throws Exception { initFlowQpsRule(); //tick(); // first make the system run on a very low condition…