You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by li...@apache.org on 2018/06/19 02:48:51 UTC
[incubator-servicecomb-java-chassis] branch master updated:
[SCB-651] Fixes bug of qps rate limit value (#770)
This is an automated email from the ASF dual-hosted git repository.
liubao pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-servicecomb-java-chassis.git
The following commit(s) were added to refs/heads/master by this push:
new 4284570 [SCB-651] Fixes bug of qps rate limit value (#770)
4284570 is described below
commit 42845706fba8d282332cda6bfd61007e675fdaa9
Author: SeanLi <li...@gmail.com>
AuthorDate: Tue Jun 19 10:48:49 2018 +0800
[SCB-651] Fixes bug of qps rate limit value (#770)
* [SCB-651] fix qps rate limit bug
Added the logic for the first cycle of the qps controller so that the number of requests allowed per second equals to the limit value.
* Update QpsController.java
Change previous modification to lastRequestCount = 1;
---
.../src/main/java/org/apache/servicecomb/qps/QpsController.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
index 4014307..8bc147b 100644
--- a/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
+++ b/handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/QpsController.java
@@ -31,7 +31,7 @@ public class QpsController {
private AtomicLong requestCount = new AtomicLong();
// 本周期之前的请求数
- private volatile long lastRequestCount = 0;
+ private volatile long lastRequestCount = 1;
private static final int CYCLE_LENGTH = 1000;