-
Notifications
You must be signed in to change notification settings - Fork 898
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
ChargebackRateDetail should take care of charging #12616
ChargebackRateDetail should take care of charging #12616
Conversation
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
As it better describes what it does. It calculates hourly cost for a given metric.
36967a7
to
8cde768
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than the minor naming comment, it looks good to me 👍
@@ -210,6 +210,17 @@ def contiguous_tiers? | |||
!error | |||
end | |||
|
|||
def affects_metrics |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure about the naming of these methods. How about metrics_keys
and cost_keys
?
This will be needed once we will have ChargebackRateDetails with dynamic rate/metric names.
Not all the rates are relevant to the given chargeback. At this moment, the field is calculated only if the given chargeback type is able to carry on the result. In future, we may be able to calculate only those fields/columns needed by user. Then this method will come in handy. Using word fields vs. columns as it is common more common in the chargeback's codebase now.
8cde768
to
4588c62
Compare
Amended the method name as advised. |
Checked commits isimluk/manageiq@16d00c3~...4588c62 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 app/models/chargeback.rb
|
Backported to Euwe via #13419 |
This moves the charging responsibility from chargeback downto chargeback_rate_detail.
This series of refactorings are the ground works for dynamic charging (needed to charge differently per different storage types). Once we have this, the rate_detail can charge per dynamic field i.e. storate_allocated_ssd_cost, storage_allocated_hiperf_cost (that is related to #12501).
@miq-bot add_label chargeback, refactoring
@miq-bot assign @gtanzillo