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

Calculate Metering Used Hours only from used metrics in metering reports #16677

Conversation

lpichler
Copy link
Contributor

@lpichler lpichler commented Dec 18, 2017

Metric Fixed Compute - is count of metric rollups (=hours) which have at least one non-zeros of chargeable metrics

Metric Used Hours

before
same as Metric Fixed Compute

after
is count of metric rollups (=hours) which have at least one non-zeros of used chargeable metrics
in discussion with @Loicavenel used chargeable metrics are these:
Memory Used, CPU Used and Network I/O Used

@miq-bot add_label bug, gaprindashvili/yes
@miq-bot assign @gtanzillo

Reproducer

  1. Manage Provider with metric and enable C&U
  2. Create Metering Vm report and add here used chargeable metrics mentioned above at least and metering used hours, fixed metric compute
  3. PUT zeros to metric in MetricRollups record for used chargeable metrics metrics
    in rails console e.g.:
# for Oct's rollups
 MetricRollup.where('extract(month from timestamp) = ?', 11).update_all({"cpu_usagemhz_rate_average"=>0, "derived_memory_used"=>0, "net_usage_rate_average"=>0})
  1. If all used chargeable metrics are zeroed then Metric Used Hours is zero

cc @nachandr

@lpichler lpichler changed the title Calculate Metering Used Hours only from used metrics on metering reports Calculate Metering Used Hours only from used metrics in metering reports Dec 18, 2017
@lpichler
Copy link
Contributor Author

@Loicavenel do we have BZ for it ?

@lpichler lpichler force-pushed the metering_used_metric_should_depends_only_on_used_metrics branch from 4b3f51e to bfd22ce Compare December 18, 2017 11:20
@miq-bot
Copy link
Member

miq-bot commented Dec 18, 2017

Checked commit lpichler@bfd22ce with ruby 2.3.3, rubocop 0.47.1, haml-lint 0.20.0, and yamllint 1.10.0
5 files checked, 0 offenses detected
Everything looks fine. 👍

@gtanzillo gtanzillo added this to the Sprint 76 Ending Jan 1, 2018 milestone Dec 19, 2017
@gtanzillo gtanzillo merged commit 2c9c3c1 into ManageIQ:master Dec 19, 2017
simaishi pushed a commit that referenced this pull request Jan 3, 2018
…epends_only_on_used_metrics

Calculate Metering Used Hours only from used metrics in metering reports
(cherry picked from commit 2c9c3c1)
@simaishi
Copy link
Contributor

simaishi commented Jan 3, 2018

Gaprindashvili backport details:

$ git log -1
commit fc83d6beb199069d81a72c5ed6f3e5a32da72c88
Author: Gregg Tanzillo <[email protected]>
Date:   Tue Dec 19 10:09:17 2017 -0500

    Merge pull request #16677 from lpichler/metering_used_metric_should_depends_only_on_used_metrics
    
    Calculate Metering Used Hours only from used metrics in metering reports
    (cherry picked from commit 2c9c3c1946f998472edbbc8dbd53477cf873072f)

@lpichler lpichler deleted the metering_used_metric_should_depends_only_on_used_metrics branch January 3, 2018 14:44
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