Extract rates cache to separate class #12608
Merged
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.
Previously, the
Chargeback
class and its descendants managed relevant ChargebackRates. TheChargeback
class suffers from feature-creep, responsibility-creep. In regards to rates, it caches them, defines assignments and selects rate to define interval.And we have more features coming (1) see #12534, (2) dynamic rates for dynamic disk types. And there is more. In future, chargeback plans for more intelligent Chargeback rate selection and caching. I have heard of rates priorities, etc. That all is better achieved in separate class. Personally, I want the cache to drop the rates that charge for 0 in the future (that will improve performance of the cb calculation itself).
@miq-bot add_label chargeback, refactoring, euwe/no
@miq-bot assign @gtanzillo