develpoerX commented on a change in pull request #2192:
URL: 
https://github.com/apache/servicecomb-java-chassis/pull/2192#discussion_r556238241



##########
File path: 
handlers/handler-loadbalance/src/test/java/org/apache/servicecomb/loadbalance/TestWeightedResponseTimeRuleExt.java
##########
@@ -73,10 +73,12 @@ public void testWeighed() {
       } else {
         server2.incrementAndGet();
       }
+      //此处是为了控制请求的时间窗口大小,使得策略中1分钟大小的时间窗口生效,并产生变化
+      Thread.sleep(1);

Review comment:
       ANS:
   1.How about not adding this ? Can this test case pass?
   If you don't add this time delay code, the 2000 request calls of the test 
simulation will be completed in a very short time, about a few seconds, so that 
the sampling results haven't been updated in time. The test result is 50%. I 
noticed that the time window algorithm used in the weighted response timerule 
ext strategy, the average reporting update interval is 200 times (according to 
the target) 10% of the previous 2000 times will follow the previous logic) the 
simulation has ended, and the scene cannot be simulated.
   2.Maybe it's better after this test case passed, and wait 1 secondes, and 
run the choose again, will give a distribution equal to 50%
   Good suggestion. I've added the number of calls to recalculate after waiting 
for one minute to see if it's recovered




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to