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

Add Metering Used Hours to chargeback report #15908

Merged
merged 6 commits into from
Oct 3, 2017

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Aug 30, 2017

Metering Used Hours is:

Which reports ?
Chargeback for VMs
Chargeback for Projects
Chargeback for Containers Images

Report definition
screen shot 2017-10-03 at 15 17 15

Example of report:
screen shot 2017-10-03 at 15 00 00
with rate $1 per month:
screen shot 2017-10-03 at 16 46 27

so the example of the calculation is:

Metering Used Metric - is count of hours in consumption period

and we will just multiple this by hourly rate from our example it is :
($1.0 / (31.0 * 24.0) ) * 277.0 = $0.37231182795698925

so generic formula is:
Hourly Rate * Metering Used Metric

Hourly Rate
we need to convert rate from rate editor to hourly rate:
from our example:
($1.0 / (31.0 * 24.0) )
(cost in rate editor / (count of hours for month/week/day - this is the 'per XXX' from rate editor ) )

@miq-bot assign @gtanzillo
/cc @Loicavenel

@miq-bot miq-bot added the wip label Aug 30, 2017
@lpichler lpichler force-pushed the add_consumed_hours_metric branch from 8e2436e to 23c9f2c Compare September 4, 2017 14:21
@gshefer
Copy link

gshefer commented Oct 1, 2017

Hello,
We need this PR to be merged ASAP in order to have it in the next Z-stream release.
Currently, we cannot test chargeback (since we cannot know the Consumed Hours Metric).
Thanks :-)

@Loicavenel
Copy link

@gshefer what Zstream are you referencing? t

@gshefer
Copy link

gshefer commented Oct 1, 2017

@Loicavenel 5.8.3 release.

@Loicavenel
Copy link

@gshefer is there a BZ behind this, I did request it for CFME 5.9 not for 5.8

@gshefer
Copy link

gshefer commented Oct 1, 2017

@Loicavenel So I must have the exact calculation for getting this metric, else we cannot test chargeback on 5.8.

@gshefer
Copy link

gshefer commented Oct 1, 2017

@lpichler @Loicavenel Can you please describe me the exact calculation that is being done for this metric? so we will be able to test Chargeback also for 5.8.

@Loicavenel
Copy link

@gshefer this is unrelated to Chargeback calculation, Hours are not used. This is extra information customer are looking for. Calculation is based on metrics collected, if a metrics exist we will count the full hour.

@gshefer
Copy link

gshefer commented Oct 2, 2017

@Loicavenel I understand from @zeari that chargeback use this metric instead of fixed_compute_metric.

@lpichler
Copy link
Contributor Author

lpichler commented Oct 2, 2017

@gshefer
yes it will be used instead of fixed_compute_metric but it has sort of different meaning.
consumed hours metric is the count of hours on the selected interval. "Selected interval" is report interval - it can be the month, week or day. The length can affect the length of the month (28, 30, 31) or time of creating the resource.
Let me finish this PR and I will show you the example of calculation.
thanks!

@lpichler lpichler force-pushed the add_consumed_hours_metric branch 2 times, most recently from 75866bd to f1f4301 Compare October 3, 2017 09:15
@Loicavenel
Copy link

@lpichler in which report this new field will be available? Chargeback & Performance reports?

@lpichler lpichler changed the title [WIP] Add consumed hours metric to chargeback report [WIP] Add Metering Used Hours to chargeback report Oct 3, 2017
@lpichler lpichler changed the title [WIP] Add Metering Used Hours to chargeback report Add Metering Used Hours to chargeback report Oct 3, 2017
@lpichler
Copy link
Contributor Author

lpichler commented Oct 3, 2017

@Loicavenel in
Chargeback for VMs
Chargeback for Projects
Chargeback for Containers Images

@lpichler
Copy link
Contributor Author

lpichler commented Oct 3, 2017

@gtanzillo @Loicavenel @zeari @gshefer PR is finished please review - I updated description.
New field is called Metering Used Hours.

@lpichler
Copy link
Contributor Author

lpichler commented Oct 3, 2017

@miq-bot remove wip

@miq-bot
Copy link
Member

miq-bot commented Oct 3, 2017

@lpichler unrecognized command 'remove', ignoring...

Accepted commands are: add_label, assign, close_issue, move_issue, remove_label, rm_label, set_milestone

@miq-bot miq-bot removed the wip label Oct 3, 2017
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 great, just a couple of minor changes requested 👍

- :metric: user_metering_hours
:group: metering
:source: used
:description: Used Metering
Copy link
Member

Choose a reason for hiding this comment

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

I think this would read better as Metering - Hours Used

@@ -45,6 +46,10 @@ def cost_keys
'total_cost']
end

def metering_used?
Copy link
Member

Choose a reason for hiding this comment

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

Perhaps this method should be named metering?

@lpichler lpichler force-pushed the add_consumed_hours_metric branch from f1f4301 to ed7b1ef Compare October 3, 2017 14:35
@miq-bot
Copy link
Member

miq-bot commented Oct 3, 2017

Checked commits lpichler/manageiq@ff2e851~...ed7b1ef with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0
12 files checked, 0 offenses detected
Everything looks fine. 👍

@lpichler
Copy link
Contributor Author

lpichler commented Oct 3, 2017

@gtanzillo updated, thanks

@gtanzillo gtanzillo added this to the Sprint 71 Ending Oct 16, 2017 milestone Oct 3, 2017
@gtanzillo gtanzillo merged commit c187deb into ManageIQ:master Oct 3, 2017
@lpichler lpichler deleted the add_consumed_hours_metric branch October 16, 2017 17:27
@simaishi
Copy link
Contributor

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.

6 participants