-
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
Add Cumulative Chargeback rates #17795
Add Cumulative Chargeback rates #17795
Conversation
bcc50b9
to
b403052
Compare
@miq-bot assign @gtanzillo @miq-bot add_label gaprindashvili/yes, blocker |
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.
LGTM 👍 Just one minor suggestion...
) do | ||
def self.new_from_h(hash) | ||
new(*hash.values_at(*members)) | ||
end | ||
|
||
def skip_field_accumulation?(field, value) | ||
return false unless cumulative_rate_calculation? |
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.
The unless
here is a little confusing. Would you mind flipping these to return false if ...
?
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.
sure I also added comment to bring clarity in this method.
thanks!
016b7d2
to
18e09f2
Compare
It is possible to assign chargeback rates to more tags from various tag categories (ManageIQ/manageiq-ui-classic#4310). It will cause costs for each rate will be added up. Example: VM has tag department/it and enviroment/test Rate 1 is assigned to tag department/it Rate 2 is assigned to tag enviroment/test Then if checkbox from (ManageIQ/manageiq-ui-classic#4310) will turn on it will add costs from Rate 1 and Rate 2 together. cost = Rate 1 + Rate 1 But metric value will not be doubled.
18e09f2
to
ccee53b
Compare
Checked commit lpichler@ccee53b with ruby 2.3.3, rubocop 0.52.1, haml-lint 0.20.0, and yamllint 1.10.0 |
…culation Add Cumulative Chargeback rates (cherry picked from commit ae59274) https://bugzilla.redhat.com/show_bug.cgi?id=1613367
Gaprindashvili backport details:
|
@lpichler Please take a look at Travis failure in G-branch:
|
Add cumulative calculation to chargeback for tagged resources
It is possible to assign chargeback rates to more tags from
various tag categories (ManageIQ/manageiq-ui-classic#4310).
It will cause costs for each rate will be added up.
Example:
VM has tag department/it and enviroment/test
Rate 1 is assigned to tag department/it
Rate 2 is assigned to tag enviroment/test
Then if checkbox from (ManageIQ/manageiq-ui-classic#4112)
will turn on it will add costs from Rate 1 and Rate 2
together.
cost = Rate 1 + Rate 1
But metric values are not affected.
This basically enabling optionally behaviour before #12534
Pictures
VM has tag
Auto Approve - Max CPU/1
Enviroment/Develompent
Rate for Auto Approve - Max CPU/1
Report Result
Rate for Enviroment/Development
Report Result
rate Enviroment Rate is assigned only to Enviroment/Development
Links
https://bugzilla.redhat.com/show_bug.cgi?id=1584018