You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
In the hotspot parameter rule, ParamKey is added to cooperate with the context attachments map to quickly specify the value that requires hotspot current limit from a large number of key-value pairs.
(#360)
Describe what this PR does / why we need it
It is convenient to specify hot spot parameters in hot spot current limiting rules. For example, there are a lot of data for system parameters, calibration parameters in header, and business parameters, and the parameters required by different businesses are different. It is very convenient to add all the data into ctx.attachments and specify the key in the rules.
Does this pull request fix one issue?
This time pr has added ParamKey, and modified the corresponding unit test and example.
Describe how you did it
ParamKey is added to the rule; trafficShaper also implements the extractArg interface correspondingly, which can be used with the existing paramIndex to easily specify hotspot parameters.
Describe how to verify it
Verified in unit test and example
Special notes for reviews
ParamKey can be considered as []string, so that users can specify hotspot rules flexibly in addition to specifying a single parameter.
For example, ParamKey=[]string{"uid","merchant_id"} This allows uid and merchant_id to be used as joint parameters as hot spots.
chore:ParamKey add supplementary explanation
chore:adjust the order of extraction parameters, give priority to paramkey, and avoid the problem of paramIndex default value 0;update test unit
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.
In the hotspot parameter rule, ParamKey is added to cooperate with the context attachments map to quickly specify the value that requires hotspot current limit from a large number of key-value pairs.
(#360)
Describe what this PR does / why we need it
It is convenient to specify hot spot parameters in hot spot current limiting rules. For example, there are a lot of data for system parameters, calibration parameters in header, and business parameters, and the parameters required by different businesses are different. It is very convenient to add all the data into ctx.attachments and specify the key in the rules.
Does this pull request fix one issue?
This time pr has added ParamKey, and modified the corresponding unit test and example.
Describe how you did it
ParamKey is added to the rule; trafficShaper also implements the extractArg interface correspondingly, which can be used with the existing paramIndex to easily specify hotspot parameters.
Describe how to verify it
Verified in unit test and example
Special notes for reviews
ParamKey can be considered as []string, so that users can specify hotspot rules flexibly in addition to specifying a single parameter.
For example, ParamKey=[]string{"uid","merchant_id"} This allows uid and merchant_id to be used as joint parameters as hot spots.