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

Introduce Consumption class to abstract charging from MetricRollups #12792

Merged
merged 8 commits into from
Nov 30, 2016

Commits on Nov 28, 2016

  1. Refactor: Extract consumption to a separate class

    This class represents a consumption of resource in given interval. This
    will enable us to introduce charging with missing metric_rollups.
    isimluk committed Nov 28, 2016
    Configuration menu
    Copy the full SHA
    3e09bbc View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    0d6e9f6 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    8f358b1 View commit details
    Browse the repository at this point in the history
  4. Configuration menu
    Copy the full SHA
    4ebf3cb View commit details
    Browse the repository at this point in the history
  5. Consumption should tell how many hours are in the interval

    No need to pass the value twice.
    isimluk committed Nov 28, 2016
    Configuration menu
    Copy the full SHA
    46be4ce View commit details
    Browse the repository at this point in the history
  6. Configuration menu
    Copy the full SHA
    5ef9f93 View commit details
    Browse the repository at this point in the history
  7. If we round to seconds we can be more accurate in fact

    Previously, we had special case to return either HOURS_IN_DAY or
    HOURS_IN_WEEK that was because the
    
        (query_end_time - query_start_time) / 1.hour
    
    without rounding returns stuff like 23.999988 hours.
    isimluk committed Nov 28, 2016
    Configuration menu
    Copy the full SHA
    2cba421 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    de586f0 View commit details
    Browse the repository at this point in the history