-
Notifications
You must be signed in to change notification settings - Fork 898
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
Charge since the first MetricRollup #14666
Conversation
app/models/chargeback/consumption.rb
Outdated
if born_at && born_at > @start_time | ||
# run this extra SELECT only when useful -- if resource was born in the current interval | ||
# metrics can be older than resource (first capture may go few days back) | ||
born_at = [born_at, resource.first_capture].compact.min |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@isimluk can we somehow reuse first_metric_rollup_record
what we already have (instead of first_capture
) ?
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1433984 On a fresh install, we start with inventory collection at time X. The resources are then created_on time X. However, the C&U collection can go few day back (by default we go back to beginning_of_day, but this is subject to configuration. (See Settings.performance.history.initial_capture_days) When charging, we cannot rely on created_on time, we can charge from the beginning of the C&U for the given resource.
Checked commits isimluk/manageiq@cc3f6c1~...cf82d67 with ruby 2.2.6, rubocop 0.47.1, and haml-lint 0.20.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
Charge since the first MetricRollup (cherry picked from commit e43ccab) https://bugzilla.redhat.com/show_bug.cgi?id=1441244
Fine backport details:
|
@isimluk @gtanzillo backporting this to Euwe branch is requested on the BZ. Would that be a problem? |
@simaishi I don't see any problem with backporting this to Euwe. |
Charge since the first MetricRollup (cherry picked from commit e43ccab) https://bugzilla.redhat.com/show_bug.cgi?id=1465077
Euwe backport details:
|
Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1433984
On a fresh install, we start with inventory collection at time X. The resources are then created_on time X. However, the C&U collection can go few day back (by default we go back to
beginning_of_day
, but this issubject to configuration. (See
Settings.performance.history.initial_capture_days
)When charging, we cannot rely on created_on time, we can charge from the beginning of the C&U for the given resource.