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

Group chargeback report for VMs by tenant #17002

Conversation

lpichler
Copy link
Contributor

Add possibility for grouping chargeback reports by tenant. Row with tenant on report considers VMs related to the tenant.

Example:

report grouped by VMs (VM1,2 are from tenant T1)

VM name Alloc. Cores Alloc. Cores Cost
VM1 2 $200
VM2 3 $300

then report grouped by Tenants (VM1,2 are from tenant T1)

Tenant 1 name Alloc. Cores Alloc. Cores Cost
T1 5 $500

Measure values and costs from VMs are summed up for their tenants on report group by tenant.

Report Result

screen shot 2018-02-14 at 21 09 47

[FROM UI PR] How to select group by tenant in report definition

screen shot 2018-02-14 at 21 09 47

Links

@miq-bot assign @gtanzillo
@miq-bot add_label enhancement, gaprindashvilli/yes

@miq-bot
Copy link
Member

miq-bot commented Feb 14, 2018

@lpichler Cannot apply the following label because they are not recognized: gaprindashvilli/yes

@lpichler
Copy link
Contributor Author

@miq-bot add_label gaprindashvili/yes

We have consumption blocks with set of metric rollups.
This set belongs to the tenant. When we do max on this set
we will get just max and it doesn't get max value for each VM.
It should take max value for each VM and then sum these
maxes.
Example: (VM1 and VM1 are in one tenant TI)
VM1: 2 Allocated Cores (Max)
VM2: 3 Allocated Cores (Max)
Report grouped  bytenant:
Tenant: 5 Allocated Cores (2 + 3 ) - is sum of maxes

And costs are derived from this values.

For avg: there is no such issue:
VM1: 2 Allocated Cores (Avg) (Cores 3 MetricRollups: 1, 2, 3)
VM2: 3 Allocated Cores (Avg)(Cores in 3 MetricRollups:2, 3, 4)
Report grouped  bytenant:
Tenant: 5 Allocated Cores (2.5)

(3 + 2) / 2 = 2.5
(1 + 2 + 3  + 2 + 3 + 4) = 2,5
It is same, AVG method don't have such issue.
@lpichler lpichler force-pushed the group_chargeback_report_for_vm_report_by_tenant branch from d023b6e to 71fea20 Compare February 15, 2018 10:18
@miq-bot
Copy link
Member

miq-bot commented Feb 15, 2018

Checked commits lpichler/manageiq@3525cfc~...71fea20 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0
8 files checked, 0 offenses detected
Everything looks fine. 🏆

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!

@gtanzillo gtanzillo added this to the Sprint 80 Ending Feb 26, 2018 milestone Feb 20, 2018
@gtanzillo gtanzillo merged commit 0d23948 into ManageIQ:master Feb 20, 2018
@lpichler lpichler deleted the group_chargeback_report_for_vm_report_by_tenant branch February 20, 2018 14:43
simaishi pushed a commit that referenced this pull request Mar 7, 2018
…m_report_by_tenant

Group chargeback report for VMs by tenant
(cherry picked from commit 0d23948)

https://bugzilla.redhat.com/show_bug.cgi?id=1552796
@simaishi
Copy link
Contributor

simaishi commented Mar 7, 2018

Gaprindashvili backport details:

$ git log -1
commit e57f8e299c25fd89d358c3a107712f04ff19d663
Author: Gregg Tanzillo <gtanzill@redhat.com>
Date:   Tue Feb 20 09:19:27 2018 -0500

    Merge pull request #17002 from lpichler/group_chargeback_report_for_vm_report_by_tenant
    
    Group chargeback report for VMs by tenant
    (cherry picked from commit 0d2394830896a4ee308670b75b567e09965e524e)
    
    https://bugzilla.redhat.com/show_bug.cgi?id=1552796

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.

4 participants