Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Break down flow.ControlBehavior to flow.TokenCalculateStrategy and flow.ControlBehavior #223

Merged

Conversation

louyuting
Copy link
Collaborator

@louyuting louyuting commented Sep 3, 2020

Describe what this PR does / why we need it

Break down flow.ControlBehavior to flow.AllocationStrategy and flow.ControlEffect

const (
	Default AllocationStrategy = iota
	WarmUp
)

const (
	Reject ControlEffect = iota
	Throttling
)

Does this pull request fix one issue?

Describe how you did it

Describe how to verify it

Special notes for reviews

@codecov-commenter
Copy link

codecov-commenter commented Sep 3, 2020

Codecov Report

Merging #223 into master will increase coverage by 0.24%.
The diff coverage is 41.17%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #223      +/-   ##
==========================================
+ Coverage   42.11%   42.35%   +0.24%     
==========================================
  Files          79       79              
  Lines        4367     4446      +79     
==========================================
+ Hits         1839     1883      +44     
- Misses       2294     2329      +35     
  Partials      234      234              
Impacted Files Coverage Δ
core/flow/rule.go 0.00% <0.00%> (ø)
core/flow/rule_manager.go 60.58% <61.03%> (+9.78%) ⬆️
core/flow/tc_default.go 23.52% <66.66%> (+23.52%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3c6af56...9aa38d6. Read the comment docs.

@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from 6774d36 to 4f770ad Compare September 3, 2020 13:18
@louyuting louyuting marked this pull request as ready for review September 3, 2020 13:30
@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from 45a24e9 to 8c472a8 Compare September 3, 2020 13:36
@louyuting louyuting added this to the 0.7.0 milestone Sep 3, 2020
@louyuting louyuting linked an issue Sep 3, 2020 that may be closed by this pull request
@louyuting louyuting added area/flow-control Issues or PRs related to flow control kind/enhancement Category issues or PRs related to enhancement labels Sep 3, 2020
@louyuting louyuting self-assigned this Sep 3, 2020

const (
Reject ControlBehavior = iota
Default AllocationStrategy = iota
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Default" seems too generic?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe Direct?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The naming had been updated.
How do you think of?

@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from 8c472a8 to c05d483 Compare September 6, 2020 06:29
@louyuting louyuting changed the title Break down flow.ControlBehavior to flow.AllocationStrategy and flow.ControlEffect Break down flow.ControlBehavior to flow.TokenAllocation and flow.ControlBehavior Sep 6, 2020
@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from b9a6a38 to e439882 Compare September 7, 2020 08:18
@louyuting louyuting modified the milestones: 0.7.0, 0.6.1 Sep 7, 2020
@louyuting louyuting changed the title Break down flow.ControlBehavior to flow.TokenAllocation and flow.ControlBehavior Break down flow.ControlBehavior to flow.TokenCalculateStrategy and flow.ControlBehavior Sep 7, 2020
@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from 3110e48 to 0fec6ae Compare September 8, 2020 05:17
@louyuting louyuting force-pushed the 20200903-breakdown-flow-ControlBehavior branch from 0fec6ae to aee8d68 Compare September 8, 2020 05:20
// Direct means flow control by current resource directly.
Direct RelationStrategy = iota
// DirectResource means flow control by current resource directly.
DirectResource RelationStrategy = iota
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DirectResource seems confusing. Maybe "CurrentResource`?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make sense

@sczyh30 sczyh30 merged commit 8a2f5c4 into alibaba:master Sep 8, 2020
@sczyh30
Copy link
Member

sczyh30 commented Sep 8, 2020

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/flow-control Issues or PRs related to flow control kind/enhancement Category issues or PRs related to enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Break down flow rule as different rule based on ControlBehavior
3 participants