Improve the parameter flow module and refactor API gateway adapter common module - #758
Merged
Conversation
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
…mFlowRuleUtil - Add a ParameterMetricStorage specific for caching ParameterMetric (moved from ParamSlot) - Add rule map building helper method in ParamFlowRuleUtil so that we can reuse it in other rule managers Signed-off-by: Eric Zhao <sczyh16@gmail.com>
…ther rule managers - Separate converted parameter rules from ParamFlowManager. Now the converted rules will be kept in GatewayRuleManager directly. - Add a GatewayFlowSlot to do separate flow checking for generated rules. - Refactor rule converting mechanism: now gateway rules in normal mode (without parameter) will also be converted to a parameter flow rule. The index will be the last (the last position). In GatewayParamParser we put a constant value to the last position. Signed-off-by: Eric Zhao <sczyh16@gmail.com>
Codecov Report
@@ Coverage Diff @@
## master #758 +/- ##
============================================
+ Coverage 41% 41.66% +0.65%
- Complexity 1335 1369 +34
============================================
Files 301 304 +3
Lines 8630 8767 +137
Branches 1159 1191 +32
============================================
+ Hits 3539 3653 +114
+ Misses 4666 4662 -4
- Partials 425 452 +27
Continue to review full report at Codecov.
|
Signed-off-by: Eric Zhao <sczyh16@gmail.com>
sczyh30
force-pushed
the
refactor/gateway-flow-161
branch
from
May 21, 2019 08:53
430d0d9 to
6e794b8
Compare
CST11021
pushed a commit
to CST11021/Sentinel
that referenced
this pull request
Nov 3, 2021
…a#758) [RIP-9] Add the introduction of the basic samples in RocketMQ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Describe what this PR does / why we need it
Improve the parameter flow module and refactor the API gateway adapter common module. See #756 for details.
Does this pull request fix one issue?
Resolves #756
Describe how you did it
FlowRuleCheckerto improve code reuse. AddcheckFlowmethod to support applying rule retrieving function and then check.ParamFlowSlotand improveParamFlowRuleUtilParameterMetricStoragespecific for caching ParameterMetric (moved from ParamSlot)ParamFlowRuleUtilso that we can reuse it in other rule managersGatewayRuleManagerdirectly.GatewayFlowSlotto do separate flow checking for generated rules.GatewayParamParserwe put a constant value to the last position to achieve the effect of non-param flow control.Describe how to verify it
Run the test cases and demo.
Special notes for reviews
Please take care of the internal breaking changes.