You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2018/06/14 08:32:24 UTC

[GitHub] limbojinne commented on a change in pull request #770: [SCB-651] Fixes bug of qps rate limit value

limbojinne commented on a change in pull request #770: [SCB-651] Fixes bug of qps rate limit value
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/770#discussion_r195340419
 
 

 ##########
 File path: handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
 ##########
 @@ -57,6 +60,11 @@ public void setQpsLimit(Integer qpsLimit) {
   public boolean isLimitNewRequest() {
     long newCount = requestCount.incrementAndGet();
     long msNow = System.currentTimeMillis();
+    if (firstCycle) {
 
 Review comment:
   Yes, it's same as setting lastRequestCount = 1. I separate the assignment clause since this issue only occurs at the beginning (i.e. in the first cycle), but the following cycles operate just as expected. 
   I committed this modification because I was expecting the number of requests allowed per second should be equal to the qps limit value. For example, 5 successful requests when setting limit value as 5. 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services