Skip to content
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

Chargeback without C & U #13884

Merged
merged 7 commits into from
Feb 16, 2017
Merged

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Feb 13, 2017

  • Allow charging for any VM (filtered by report options)
    @options[:include_metrics] on the report means
    nil - (default) include metrics rollups
    true - include metric rollups
    false - don't include metric rollups

this covering method include_metrics?
which is returning only false or true

  • Avoid charging resources with metric rollups
    when options.include_metrics? is false

  • I am sorry for commit
    I separate testing chargeback by metric with/without rollups by context.
    I need to have clean setup for testing chargeback without any created VMs
    So in the commit is just aligning code by 2 spaces after separation in commit

@miq-bot assign @gtanzillo
@miq-bot add_label chargeback, enhancement

please review @isimluk

@miq-bot
Copy link
Member

miq-bot commented Feb 13, 2017

This pull request is not mergeable. Please rebase and repush.

@miq-bot
Copy link
Member

miq-bot commented Feb 14, 2017

This pull request is not mergeable. Please rebase and repush.

Copy link
Member

@isimluk isimluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member

@gtanzillo gtanzillo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good 👍 Will merge after conflicts are resolved.

@lpichler
Copy link
Contributor Author

per discussion with @gtanzillo I flip semantic in option for this feature, from
options[:without_metric_rollups] to options[:include_metrics] to be more understandable

conflicts resolved 👍
thanks

@options[:include_metrics] is on the report means
nil   - (default) include metrics rollups
true  - include metric rollups
false - don't include metric rollups

this covering methond include_metrics?
which is returning false or true
when ReportOptions#include_metrics? is false
@miq-bot
Copy link
Member

miq-bot commented Feb 16, 2017

Checked commits lpichler/manageiq@529bda8~...939fd8f with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
4 files checked, 1 offense detected

spec/models/chargeback_vm_spec.rb

# support hyper-v for which we do not collect metrics yet
scope = ManageIQ::Providers::Microsoft::InfraManager::Vm
# support hyper-v for which we do not collect metrics yet (also when we are including metrics in calculations)
scope = @options.include_metrics? ? ManageIQ::Providers::Microsoft::InfraManager::Vm : vms
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

aside: we need to get this class reference out of here.

@gtanzillo gtanzillo added this to the Sprint 55 Ending Feb 27, 2017 milestone Feb 16, 2017
@kbrock kbrock merged commit bb08973 into ManageIQ:master Feb 16, 2017
@lpichler lpichler deleted the chargeback_without_c_and_u branch February 16, 2017 15:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants