feat: add 'cost' method to upgrade prioritization#452
Merged
danielolsen merged 1 commit intodevelopfrom Apr 22, 2021
Merged
Conversation
BainanXia
reviewed
Apr 20, 2021
b22a208 to
1fb66b0
Compare
This was referenced Apr 22, 2021
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.
Purpose
Allow user to prioritize branch upgrades based on estimated cost in the numerator (where the denominator remains the congestion shadow price at a certain quantile). See #439 for details.
What the code is doing
The main logic is in the
if method == "cost":block: we calculate the cost of upgrading each of the congested branches by 1x their original value, and then we divide the congestion metric by these values to get the branch upgrade ranking.We also do a little simplification of the code where we calculate the bidirectional congestion, and move the application of the
composite_allow_listfilter up higher for better efficiency (so that we don't calculate quantiles for branches we know we're not going to select anyway), but these should have no effect on the results of the code.Time estimate
10 minutes. Most of the work to enable this feature was actually contained in #450.