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 2022/01/14 02:27:59 UTC

[GitHub] [servicecomb-java-chassis] david6969xin opened a new pull request #2695: [SCB-2369] improve fow controller logs and message

david6969xin opened a new pull request #2695:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2695


   Follow this checklist to help us incorporate your contribution quickly and easily:
   
    - [ ] Make sure there is a [JIRA issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually before you start working on it).  Trivial changes like typos do not require a JIRA issue.  Your pull request should address just this issue, without pulling in other changes.
    - [ ] Each commit in the pull request should have a meaningful subject line and body.
    - [ ] Format the pull request title like `[SCB-XXX] Fixes bug in ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA issue.
    - [ ] Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
    - [ ] Run `mvn clean install -Pit` to make sure basic checks pass. A more thorough check will be performed on your pull request automatically.
    - [ ] If this contribution is large, please file an Apache [Individual Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   
   ---
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] codecov-commenter commented on pull request #2695: [SCB-2369] improve fow controller logs and message

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on pull request #2695:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2695#issuecomment-1012894457


   # [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#2695](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (6f5a377) into [master](https://codecov.io/gh/apache/servicecomb-java-chassis/commit/c1cb7381c7b46ca5be7dda1eba5eef226558133f?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (c1cb738) will **decrease** coverage by `0.00%`.
   > The diff coverage is `100.00%`.
   
   > :exclamation: Current head 6f5a377 differs from pull request most recent head 1cef5d4. Consider uploading reports for the commit 1cef5d4 to get more accurate results
   [![Impacted file tree graph](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/graphs/tree.svg?width=650&height=150&src=pr&token=KXfDcr9rX2&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   
   ```diff
   @@             Coverage Diff              @@
   ##             master    #2695      +/-   ##
   ============================================
   - Coverage     77.76%   77.76%   -0.01%     
     Complexity     1430     1430              
   ============================================
     Files          1598     1598              
     Lines         42774    42780       +6     
     Branches       3610     3611       +1     
   ============================================
   + Hits          33262    33266       +4     
   - Misses         7998     7999       +1     
   - Partials       1514     1515       +1     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [.../servicecomb/demo/pojo/client/TestFlowControl.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-ZGVtby9kZW1vLXBvam8vcG9qby1jbGllbnQvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL2RlbW8vcG9qby9jbGllbnQvVGVzdEZsb3dDb250cm9sLmphdmE=) | `92.30% <100.00%> (ø)` | |
   | [...servicecomb/qps/ConsumerQpsFlowControlHandler.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aGFuZGxlcnMvaGFuZGxlci1mbG93Y29udHJvbC1xcHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3Fwcy9Db25zdW1lclFwc0Zsb3dDb250cm9sSGFuZGxlci5qYXZh) | `75.00% <100.00%> (ø)` | |
   | [...servicecomb/qps/ProviderQpsFlowControlHandler.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aGFuZGxlcnMvaGFuZGxlci1mbG93Y29udHJvbC1xcHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3Fwcy9Qcm92aWRlclFwc0Zsb3dDb250cm9sSGFuZGxlci5qYXZh) | `87.50% <100.00%> (ø)` | |
   | [.../servicecomb/qps/strategy/FixedWindowStrategy.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aGFuZGxlcnMvaGFuZGxlci1mbG93Y29udHJvbC1xcHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3Fwcy9zdHJhdGVneS9GaXhlZFdpbmRvd1N0cmF0ZWd5LmphdmE=) | `75.00% <100.00%> (+8.33%)` | :arrow_up: |
   | [.../servicecomb/qps/strategy/LeakyBucketStrategy.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-aGFuZGxlcnMvaGFuZGxlci1mbG93Y29udHJvbC1xcHMvc3JjL21haW4vamF2YS9vcmcvYXBhY2hlL3NlcnZpY2Vjb21iL3Fwcy9zdHJhdGVneS9MZWFreUJ1Y2tldFN0cmF0ZWd5LmphdmE=) | `85.71% <100.00%> (+1.50%)` | :arrow_up: |
   | [...egistry/client/http/ServiceRegistryClientImpl.java](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-c2VydmljZS1yZWdpc3RyeS9yZWdpc3RyeS1zZXJ2aWNlLWNlbnRlci9zcmMvbWFpbi9qYXZhL29yZy9hcGFjaGUvc2VydmljZWNvbWIvc2VydmljZXJlZ2lzdHJ5L2NsaWVudC9odHRwL1NlcnZpY2VSZWdpc3RyeUNsaWVudEltcGwuamF2YQ==) | `70.88% <0.00%> (-0.39%)` | :arrow_down: |
   
   ------
   
   [Continue to review full report at Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   > **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   > `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
   > Powered by [Codecov](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Last update [c1cb738...1cef5d4](https://codecov.io/gh/apache/servicecomb-java-chassis/pull/2695?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation).
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] develpoerX commented on a change in pull request #2695: [SCB-2369] improve fow controller logs and message

Posted by GitBox <gi...@apache.org>.
develpoerX commented on a change in pull request #2695:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2695#discussion_r784474897



##########
File path: handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/ConsumerQpsFlowControlHandler.java
##########
@@ -38,9 +47,20 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) throws Except
     }
 
     QpsStrategy qpsStrategy = qpsControllerMgr.getOrCreate(invocation.getMicroserviceName(), invocation);
+    String name = qpsStrategy.name();
     if (qpsStrategy.isLimitNewRequest()) {
+      long tps = 0;
+      if ("FixedWindow".equals(name)) {
+        FixedWindowStrategy windowStrategy = (FixedWindowStrategy) qpsControllerMgr.getGlobalQpsStrategy();
+        tps = windowStrategy.getRequestCount().longValue() - windowStrategy.getLastRequestCount() + 1;
+      } else {
+        LeakyBucketStrategy bucketStrategy = (LeakyBucketStrategy) qpsControllerMgr.getGlobalQpsStrategy();
+        tps = bucketStrategy.getRequestCount().longValue();
+      }
       // return http status 429
-      CommonExceptionData errorData = new CommonExceptionData("rejected by qps flowcontrol");
+      LOGGER.warn("consumer qps flowcontrol open, qpsLimit is {} and tps is {}", qpsLimit, tps);

Review comment:
       Log logic basis? A warn level log is a generic error that does not affect business logic.




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 merged pull request #2695: [SCB-2369] improve fow controller logs and message

Posted by GitBox <gi...@apache.org>.
liubao68 merged pull request #2695:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2695


   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] liubao68 commented on a change in pull request #2695: [SCB-2369] improve fow controller logs and message

Posted by GitBox <gi...@apache.org>.
liubao68 commented on a change in pull request #2695:
URL: https://github.com/apache/servicecomb-java-chassis/pull/2695#discussion_r784468439



##########
File path: handlers/handler-flowcontrol-qps/src/main/java/org/apache/servicecomb/qps/ConsumerQpsFlowControlHandler.java
##########
@@ -38,9 +47,20 @@ public void handle(Invocation invocation, AsyncResponse asyncResp) throws Except
     }
 
     QpsStrategy qpsStrategy = qpsControllerMgr.getOrCreate(invocation.getMicroserviceName(), invocation);
+    String name = qpsStrategy.name();
     if (qpsStrategy.isLimitNewRequest()) {
+      long tps = 0;

Review comment:
       Encapsulation 




-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@servicecomb.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org