-
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
Introduce Consumption class to abstract charging from MetricRollups #12792
Merged
Conversation
This file contains 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
<pr_mergeability_checker />This pull request is not mergeable. Please rebase and repush. |
This class represents a consumption of resource in given interval. This will enable us to introduce charging with missing metric_rollups.
No need to pass the value twice.
Previously, we had special case to return either HOURS_IN_DAY or HOURS_IN_WEEK that was because the (query_end_time - query_start_time) / 1.hour without rounding returns stuff like 23.999988 hours.
isimluk
force-pushed
the
refactor-cb-consumption
branch
from
November 28, 2016 16:36
f588c92
to
de586f0
Compare
Checked commits isimluk/manageiq@3e09bbc~...de586f0 with ruby 2.2.5, rubocop 0.37.2, and haml-lint 0.16.1 |
👍 Looks great! |
Backported to Euwe via #13419 |
Fryguy
added a commit
to Fryguy/manageiq
that referenced
this pull request
Feb 8, 2017
After the backport of ManageIQ#12792 and ManageIQ#13700, a user can be in a state where their VimPerformanceOperatingRanges are inconsistent. Although it doesn't really harm anything, this data migration makes it consistent once again.
Fryguy
added a commit
to Fryguy/manageiq
that referenced
this pull request
Mar 1, 2017
After the backport of ManageIQ#12792 and ManageIQ#13700, a user can be in a state where their VimPerformanceOperatingRanges are inconsistent. Although it doesn't really harm anything, this data migration makes it consistent once again.
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.
What
Encapsulate chargeback's manipulation with metric_rollups to a separate class.
Why?
When charging we take into account three main inputs
MetricRollup
)Chargeback::RatesCache
&ChargebackRate*
)Chargeback::ReportOptions
)Now, let's investigate, why we need consumption to be polymorphic:
consumption == single metric_rollup
.Other notes
I have found some irregularities in a way we handle @hours_in_interval. (related to starts/ends of interval & rates interval, vs report interval). The Consumption object will make it easier to address these irregularities.
@miq-bot add_label chargeback, refactoring
@miq-bot assign @gtanzillo