-
Notifications
You must be signed in to change notification settings - Fork 897
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
Rate selection using union of all tags in reporting(consumption) period #15888
Merged
gtanzillo
merged 5 commits into
ManageIQ:master
from
lpichler:chargeback-all-tags-in-period
Sep 12, 2017
Merged
Rate selection using union of all tags in reporting(consumption) period #15888
gtanzillo
merged 5 commits into
ManageIQ:master
from
lpichler:chargeback-all-tags-in-period
Sep 12, 2017
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
lpichler
changed the title
[WIP] Rate selection using union of all tags in reporting period
[WIP] Rate selection using union of all tags in reporting(consumption) period
Aug 24, 2017
lpichler
force-pushed
the
chargeback-all-tags-in-period
branch
from
August 24, 2017 10:26
53b51b7
to
9d22a4f
Compare
lpichler
changed the title
[WIP] Rate selection using union of all tags in reporting(consumption) period
Rate selection using union of all tags in reporting(consumption) period
Aug 24, 2017
Previously, tag list was determined from first metric rollup of the period but it is not enough to use tag list only from first rollup and tag list can be changed during period. Now we are using tag list from metric rollup records of consumption period. Source: ManageIQ#15857
selection of assignments of rates depend on tags and parents from consumption. We store those rates to the hash and hash is indexed by tags and parents (this is basically hash_features_affecting_rate) This change is about that we are taking tags from whole period instead of only first metric rollup. Taken from https://github.com/ManageIQ/manageiq/pull/15857/files#diff-38b8d2b191409f1f9bee0b0b0be19e4eR34 but I added check whether tag_names are nil and uniq method has been replaced by OR operator: memo |= rollup.tag_names.split('|') and there is used inject to eliminate two cycles (one would be for select of non-nil tag_names and second for map)
as we are using one metric_rollup and changing it to get then we need to refresh instance variables of consumption
lpichler
force-pushed
the
chargeback-all-tags-in-period
branch
from
August 24, 2017 11:38
9d22a4f
to
7b602ea
Compare
Checked commits lpichler/manageiq@9b9cba0~...7b602ea with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
gtanzillo
approved these changes
Sep 12, 2017
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
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.
pulled out from #15857
Issue:
Metric rollups are grouped to so called consumption. we are charging and selection rates regard to consumption. Tags to determine which rates should be selected were taken from first metric rollup
of consumption but it is possible that this rollup don't have tags yet and it was causing the issue.
Solution:
Fix is about taking tags from whole consumption period.
@gtanzillo I did small changes on your code and I added and fix specs. Thanks!
@miq-bot assign @gtanzillo
@miq-bot add_label chargeback, bug